Skip to content

Commit d5c6496

Browse files
committed
Improve trimmability
1 parent ce1b0e2 commit d5c6496

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

src/Ultra.Core/Ultra.Core.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@
2727
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
2828
</PropertyGroup>
2929

30-
<ItemGroup>
31-
<Compile Include="..\Ultra.Sampler\UltraSamplerConstants.cs" Link="UltraSamplerConstants.cs" />
32-
</ItemGroup>
33-
3430
<ItemGroup>
3531
<None Include="$(MSBuildThisFileDirectory)../../img/ultra.png" Pack="true" PackagePath="/" />
3632
<None Include="readme.md" Pack="true" PackagePath="/" />
@@ -55,4 +51,8 @@
5551
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
5652
</Content>
5753
</ItemGroup>
54+
55+
<ItemGroup>
56+
<ProjectReference Include="..\Ultra.Sampler\Ultra.Sampler.csproj" />
57+
</ItemGroup>
5858
</Project>

src/Ultra.Sampler/UltraSamplerSource.cs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace Ultra.Sampler;
1111
[EventSource(Name = UltraSamplerConstants.ProviderName)] // Cannot set the ProviderGuid that is not used https://github.com/dotnet/diagnostics/issues/389
1212
internal sealed class UltraSamplerSource : EventSource
1313
{
14+
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(UltraSamplerSource))]
1415
public static readonly UltraSamplerSource Log = new();
1516

1617
private UltraSamplerSource()
0 Bytes
Binary file not shown.

src/Ultra.Tests/UltraSamplerTests.cs

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the BSD-Clause 2 license.
33
// See license.txt file in the project root for full license information.
44

5+
using Ultra.Core;
56
using Ultra.Sampler;
67
using Ultra.Sampler.MacOS;
78

@@ -23,4 +24,12 @@ public void TestNativeModules()
2324
Console.WriteLine($"{nativeModule}");
2425
}
2526
}
27+
28+
[TestMethod]
29+
public void TestEventSource()
30+
{
31+
var sampler = UltraSamplerSource.Log;
32+
Assert.AreEqual(UltraSamplerConstants.ProviderName, sampler.Name);
33+
Assert.AreEqual(UltraSamplerConstants.ProviderGuid, sampler.Guid);
34+
}
2635
}

0 commit comments

Comments
 (0)