Fix some small issues and experiment with C#

This commit is contained in:
Dimitris Zervas
2024-02-27 03:01:29 +02:00
parent 62e98de539
commit a89850d410
16 changed files with 287 additions and 37 deletions

19
examples/cs/My/MyClass.cs Normal file
View File

@ -0,0 +1,19 @@
using System;
using OtherNamespace;
namespace MyNamespace {
public class MyClass {
// This method will be called by native code inside the target process…
public static int MyMethod(String pwzArgument) {
System.Console.WriteLine("Hello World from C# {0}", pwzArgument);
return 0;
}
public static void Main() {
int my = MyMethod("from Main()");
System.Console.WriteLine("MyMethod returned {0}", my);
int other = OtherNamespace.OtherClass.OtherMethod();
System.Console.WriteLine("OtherMethod returned {0}", other);
}
}
}

View File

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Other\OtherClass.csproj" />
</ItemGroup>
</Project>