diff --git a/NATS.Client.sln b/NATS.Client.sln index 930a9f0c9..dc67eb550 100644 --- a/NATS.Client.sln +++ b/NATS.Client.sln @@ -81,6 +81,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example.ObjectStore", "sand EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example.TlsFirst", "sandbox\Example.TlsFirst\Example.TlsFirst.csproj", "{88625045-978F-417F-9F51-A4E3A9718945}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example.NativeAot", "sandbox\Example.NativeAot\Example.NativeAot.csproj", "{51362D87-49C8-414C-AAB7-E51B946231E7}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -207,6 +209,10 @@ Global {88625045-978F-417F-9F51-A4E3A9718945}.Debug|Any CPU.Build.0 = Debug|Any CPU {88625045-978F-417F-9F51-A4E3A9718945}.Release|Any CPU.ActiveCfg = Release|Any CPU {88625045-978F-417F-9F51-A4E3A9718945}.Release|Any CPU.Build.0 = Release|Any CPU + {51362D87-49C8-414C-AAB7-E51B946231E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {51362D87-49C8-414C-AAB7-E51B946231E7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {51362D87-49C8-414C-AAB7-E51B946231E7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {51362D87-49C8-414C-AAB7-E51B946231E7}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -243,6 +249,7 @@ Global {BB2F4EEE-1AB3-43F7-B004-6C9B3D52353E} = {C526E8AB-739A-48D7-8FC4-048978C9B650} {51882883-A66E-4F95-A1AB-CFCBF71B4376} = {95A69671-16CA-4133-981C-CC381B7AAA30} {88625045-978F-417F-9F51-A4E3A9718945} = {95A69671-16CA-4133-981C-CC381B7AAA30} + {51362D87-49C8-414C-AAB7-E51B946231E7} = {95A69671-16CA-4133-981C-CC381B7AAA30} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {8CBB7278-D093-448E-B3DE-B5991209A1AA} diff --git a/sandbox/Example.NativeAot/.gitignore b/sandbox/Example.NativeAot/.gitignore new file mode 100644 index 000000000..849ddff3b --- /dev/null +++ b/sandbox/Example.NativeAot/.gitignore @@ -0,0 +1 @@ +dist/ diff --git a/sandbox/Example.NativeAot/Example.NativeAot.csproj b/sandbox/Example.NativeAot/Example.NativeAot.csproj new file mode 100644 index 000000000..ccce11946 --- /dev/null +++ b/sandbox/Example.NativeAot/Example.NativeAot.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + enable + enable + true + + + + + + + diff --git a/sandbox/Example.NativeAot/Program.cs b/sandbox/Example.NativeAot/Program.cs new file mode 100644 index 000000000..602a58d34 --- /dev/null +++ b/sandbox/Example.NativeAot/Program.cs @@ -0,0 +1,13 @@ +using NATS.Client.Core; + +await using var nats = new NatsConnection(); + +await using var sub = await nats.SubscribeAsync("foo"); + +await nats.PingAsync(); + +await nats.PublishAsync("foo", 1); + +var msg = await sub.Msgs.ReadAsync(); + +Console.WriteLine(msg.Data); diff --git a/sandbox/Example.NativeAot/run.bat b/sandbox/Example.NativeAot/run.bat new file mode 100644 index 000000000..95c077bc6 --- /dev/null +++ b/sandbox/Example.NativeAot/run.bat @@ -0,0 +1,2 @@ +dotnet publish -r win-x64 -c Release -o dist +.\dist\Example.NativeAot.exe diff --git a/sandbox/Example.NativeAot/run.sh b/sandbox/Example.NativeAot/run.sh new file mode 100644 index 000000000..7ed0c8a9c --- /dev/null +++ b/sandbox/Example.NativeAot/run.sh @@ -0,0 +1,2 @@ +dotnet publish -r linux-x64 -c Release -o dist +./dist/Example.NativeAot