diff --git a/src/Ultra.Core/Ultra.Core.csproj b/src/Ultra.Core/Ultra.Core.csproj index fff14ed..3750678 100644 --- a/src/Ultra.Core/Ultra.Core.csproj +++ b/src/Ultra.Core/Ultra.Core.csproj @@ -27,10 +27,6 @@ True - - - - @@ -55,4 +51,8 @@ PreserveNewest + + + + diff --git a/src/Ultra.Sampler/UltraSamplerSource.cs b/src/Ultra.Sampler/UltraSamplerSource.cs index 18d91b4..b0bdc3b 100644 --- a/src/Ultra.Sampler/UltraSamplerSource.cs +++ b/src/Ultra.Sampler/UltraSamplerSource.cs @@ -11,6 +11,7 @@ namespace Ultra.Sampler; [EventSource(Name = UltraSamplerConstants.ProviderName)] // Cannot set the ProviderGuid that is not used https://github.com/dotnet/diagnostics/issues/389 internal sealed class UltraSamplerSource : EventSource { + [DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(UltraSamplerSource))] public static readonly UltraSamplerSource Log = new(); private UltraSamplerSource() diff --git a/src/Ultra.Sampler/libUltraSampler.dylib b/src/Ultra.Sampler/libUltraSampler.dylib index 783a879..1e6e63a 100644 Binary files a/src/Ultra.Sampler/libUltraSampler.dylib and b/src/Ultra.Sampler/libUltraSampler.dylib differ diff --git a/src/Ultra.Tests/UltraSamplerTests.cs b/src/Ultra.Tests/UltraSamplerTests.cs index 636c507..9eeb48f 100644 --- a/src/Ultra.Tests/UltraSamplerTests.cs +++ b/src/Ultra.Tests/UltraSamplerTests.cs @@ -2,6 +2,7 @@ // Licensed under the BSD-Clause 2 license. // See license.txt file in the project root for full license information. +using Ultra.Core; using Ultra.Sampler; using Ultra.Sampler.MacOS; @@ -23,4 +24,12 @@ public void TestNativeModules() Console.WriteLine($"{nativeModule}"); } } + + [TestMethod] + public void TestEventSource() + { + var sampler = UltraSamplerSource.Log; + Assert.AreEqual(UltraSamplerConstants.ProviderName, sampler.Name); + Assert.AreEqual(UltraSamplerConstants.ProviderGuid, sampler.Guid); + } } \ No newline at end of file