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

Enable SingleFileAnalyzer #47282

Merged
merged 2 commits into from
Mar 20, 2023
Merged

Conversation

eerhardt
Copy link
Member

When publishing an app that uses WebApplication.CreateBuilder, we are getting unnecessary warnings.

We need the single file analyzer enabled in our code that is trimmable/AOT-able. When publishing for NativeAOT, the app is built into a single file, so we also need to ensure our code works correctly in single file mode.

Note, I logged dotnet/sdk#31284 so this analyzer gets enabled by default when EnableAotAnalyzer=true.

When publishing an app that uses WebApplication.CreateBuilder, we are getting unnecessary warnings.

We need the single file analyzer enabled in our code that is trimmable/AOT-able. When publishing for NativeAOT, the app is built into a single file, so we also need to ensure our code works correctly in single file mode.
@eerhardt eerhardt requested review from JamesNK and amcasey March 17, 2023 18:55
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Mar 17, 2023
@ghost
Copy link

ghost commented Mar 17, 2023

Hey @dotnet/aspnet-build, looks like this PR is something you want to take a look at.

Copy link
Member

@amcasey amcasey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know enough about the structure of our targets files to be confident that's the right one, but the change looks like it will do what we want and is consistent with similar functionality.

Directory.Build.targets Show resolved Hide resolved
Co-authored-by: James Newton-King <james@newtonking.com>
@eerhardt eerhardt enabled auto-merge (squash) March 20, 2023 15:55
@eerhardt eerhardt merged commit 7a4829d into dotnet:main Mar 20, 2023
@ghost ghost added this to the 8.0-preview3 milestone Mar 20, 2023
@eerhardt eerhardt deleted the FixSingleFileWarnings branch March 23, 2023 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants