Skip to content

Commit aa9edcc

Browse files
Fix S.D.Tracing testapps with AOT (#101373)
I believe what the test is doing is not trim safe and only succeeds due to lucky IL trimming implementation details.
1 parent f8903fe commit aa9edcc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/libraries/System.Diagnostics.Tracing/tests/TrimmingTests/EventSourcePropertyValueTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System.Collections.Generic;
55
using System.Collections.ObjectModel;
6+
using System.Diagnostics.CodeAnalysis;
67
using System.Diagnostics.Tracing;
78

89
/// <summary>
@@ -34,6 +35,7 @@ private class TestEventSource : EventSource
3435
public TestEventSource() : base(EventSourceSettings.EtwSelfDescribingEventFormat) { }
3536

3637
[Event(1)]
38+
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicProperties, typeof(TestSubData))]
3739
public void LogData(TestData data)
3840
{
3941
Write("LogData", data);

src/libraries/tests.proj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,6 @@
648648
Condition="'$(TestPackages)' == 'true'" />
649649

650650
<!-- We need to go over these disablements: https://github.com/dotnet/runtime/issues/101228 -->
651-
<ProjectExclusions Condition="'$(RunNativeAotTestApps)' == 'true'" Include="$(MSBuildThisFileDirectory)\System.Diagnostics.Tracing\tests\TrimmingTests\System.Diagnostics.Tracing.TrimmingTests.proj" />
652651
<ProjectExclusions Condition="'$(RunNativeAotTestApps)' == 'true'" Include="$(MSBuildThisFileDirectory)\System.Linq.Queryable\tests\TrimmingTests\System.Linq.Queryable.TrimmingTests.proj" />
653652
<ProjectExclusions Condition="'$(RunNativeAotTestApps)' == 'true'" Include="$(MSBuildThisFileDirectory)\System.Private.Xml.Linq\tests\TrimmingTests\System.Xml.Linq.TrimmingTests.proj" />
654653
<ProjectExclusions Condition="'$(RunNativeAotTestApps)' == 'true'" Include="$(MSBuildThisFileDirectory)\System.Net.Http\tests\TrimmingTests\System.Net.Http.TrimmingTests.proj" />

0 commit comments

Comments
 (0)