-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppresses the trimmer warning on TypeAnalysis ctor #48823
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti Issue DetailsEventSource serialization calls TypeAnalysis ctor recursively with different types through the datatype parameter which the trimmer does not handle. This can cause problems trimming applications with EventSource. Suppressing the warning in the TypeAnalysis ctor since its not actionable by EventSource users. Added RequiresUnreferencedCode to relevant WriteEvent and Write methods in EventSource to warn users that trimming can cause problems. Went through the library EventSource that use the above Event methods and made sure that they are safe and suppressed the warnings.
|
…essing the warning to get FB, not fully fixed
src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.cs
Show resolved
Hide resolved
...ystem.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs
Show resolved
Hide resolved
src/libraries/Common/src/System/Net/Security/NetEventSource.Security.Windows.cs
Show resolved
Hide resolved
src/libraries/Common/src/System/Net/Security/NetEventSource.Security.Windows.cs
Show resolved
Hide resolved
@@ -10,7 +10,11 @@ | |||
<ItemGroup> | |||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" Version="$(MicrosoftCodeAnalysisCSharpVersion)" /> | |||
</ItemGroup> | |||
|
|||
|
|||
<ItemGroup Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) != '.NETCoreApp'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This project only builds for netstandard2.0
. No need for this condition.
These two new warnings came in because of: 1. dotnet#48823 2. dotnet#47938
EventSource serialization calls TypeAnalysis ctor recursively with different types through the datatype parameter which the trimmer does not handle. This can cause problems trimming applications with EventSource.
Suppressing the warning in the TypeAnalysis ctor since its not actionable by EventSource users. Added RequiresUnreferencedCode to relevant WriteEvent and Write methods in EventSource to warn users that trimming can cause problems.
Went through the library EventSource that use the above Event methods and made sure that they are safe and suppressed the warnings.