Skip to content

Document NETSDK1195 #35655

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

Merged
merged 4 commits into from
Jun 6, 2023
Merged

Document NETSDK1195 #35655

merged 4 commits into from
Jun 6, 2023

Conversation

sbomer
Copy link
Member

@sbomer sbomer commented Jun 5, 2023

Add detailed documentation on NETSDK1195, with actionable suggestions to resolve it.


Internal previews

📄 File 🔗 Preview link
docs/core/tools/sdk-errors/index.md .NET SDK error list
docs/core/tools/sdk-errors/netsdk1195.md docs/core/tools/sdk-errors/netsdk1195

Copy link
Contributor

@tdykstra tdykstra left a comment

Choose a reason for hiding this comment

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

Looks good -- a couple of minor suggestions, and this article needs to be added to toc.yml

@sbomer sbomer requested a review from a team as a code owner June 5, 2023 21:42
@MichalPetryka
Copy link

So there is no workaround for enabling the analyzers with netstandard libraries, right?

@sbomer
Copy link
Member Author

sbomer commented Jun 5, 2023

There's no documented workaround, but it is possible to work around this by playing games with KnownILLinkPack, if you're willing to accept the caveats mentioned in dotnet/linker#3175. The workaround is mentioned here: dotnet/aspnetcore#45879 (comment).

- Trimming (via `PublishTrimmed` or `PublishAot`)
- Trim analysis (via `PublishTrimmed`, `PublishAot`, `IsTrimmable`, `IsAotCompatible`, or `EnableTrimAnalyzer`)
- Single-file analysis (via `PublishSingleFile` or `EnableSingleFileAnalyzer`)
- Ahead-of-time compilation analysis (via `PublishAot` or `EnableAotAnalyzer`)
Copy link
Member

Choose a reason for hiding this comment

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

This might give the false impression that AOT analysis will work on netcoreapp3.0 - maybe we should mention that this is only really supported on net7.0 and above.

Which leads me to another question: Maybe we should issue this warning when somebody targets net6.0 and sets PublishAot for example. Or maybe we should have a similar warning for AOT. It's basically the same story as for trimming and netstandard2.0. It won't do anything but it will provide false "hope" that the app doesn't have AOT incompatibilities.

Copy link
Member Author

Choose a reason for hiding this comment

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

There is a separate error about the ILCompiler pack - if you try PublishAot on net6.0 it'll say:

error NETSDK1183: Ahead-of-time compilation is not supported for the target framework.

See dotnet/sdk#32943 which made this error more specific.

Copy link
Member

@vitek-karas vitek-karas left a comment

Choose a reason for hiding this comment

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

Other than the AOT specific comment - which we should probably turn into a separate issue, this looks good.

@tdykstra tdykstra merged commit 5b3a02a into dotnet:main Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants