Skip to content
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

Merged
merged 42 commits into from
Mar 8, 2021

Conversation

LakshanF
Copy link
Contributor

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.

@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

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.

@ghost
Copy link

ghost commented Feb 26, 2021

Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti
See info in area-owners.md if you want to be subscribed.

Issue Details

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.

Author: LakshanF
Assignees: -
Labels:

area-System.Diagnostics.Tracing, new-api-needs-documentation

Milestone: -

@LakshanF LakshanF merged commit 07ea61f into dotnet:main Mar 8, 2021
@@ -10,7 +10,11 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" Version="$(MicrosoftCodeAnalysisCSharpVersion)" />
</ItemGroup>


<ItemGroup Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) != '.NETCoreApp'">
Copy link
Member

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.

eerhardt added a commit to eerhardt/runtime that referenced this pull request Mar 19, 2021
stephentoub pushed a commit that referenced this pull request Mar 21, 2021
…on (#49887)

* Resolve new ILLink warnings in Microsoft.Extensions.DependencyInjection

These two new warnings came in because of:

1. #48823
2. #47938

* Use GetProperty.
@ghost ghost locked as resolved and limited conversation to collaborators Apr 8, 2021
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
@LakshanF LakshanF deleted the EventSrcWrnFix2 branch May 10, 2022 13:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Diagnostics.Tracing linkable-framework Issues associated with delivering a linker friendly framework new-api-needs-documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants