-
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
[area-Tools-ILLink]: dotnet publish crashing when using PublishTrimmed option #109536
Comments
Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas |
It's likely a dupe of #93800 which has the same callstack - as part of that investigation I looked around the other warnings and didn't see a similar problem in any other case. |
I can see that the possible dupe has been open over one year already. It is generally a good idea to wrap your logging code inside a try-catch to make issues in logging non-fatal, so could you consider doing at least that while waiting for the actual fix? |
…ormatting diagnostics (#110229) Fixes #109536 See #93800 for more context. When a NullableValue is the source of an assignment, we consider use the TypeArgumentTargetsX diagnostic since the underlying value is a generic argument, but use the source of the generic argument for diagnostics. This leads to some confusing warning messages, and sometimes crashes in formatting the diagnostics. Ideally, we would want to unwrap the NullableValues and use the UnderlyingTypeValue as the source, but this would be a breaking change for the situations that don't crash. FieldValue and MethodReturnValue only provide 1 diagnostic arguments, but the diagnostics for TypeArgumentTargetsX expects 2 arguments from the source. This caused crashes when the situation was encountered. Since they didn't work before at all, this won't be a breaking change to provide the correct warning here.
Description
When trying to run do "dotnet publish --configuration Release --output publish\x --self-contained true" for my project I'm getting this:dotnet.zip
Attached a mini dump without heap, because apparently the mini dump with heap is too large for Github. I can provide dump with heap any time if needed.
Reproduction Steps
I can repro every time by just running the "dotnet publish --configuration Release --output publish\x --self-contained true". I'd rather not share my full code. If you are not able to figure it out from the dump / call stack we can see if I can do something to help you further.
Expected behavior
Not crashing
Actual behavior
Crashing
Regression?
Unknown.
Known Workarounds
No known workaround.
Configuration
Latest .NET 8, Windows 11 23H2 (Build 22631.4317), x64. Not tested on other platforms.
Other information
As call stack shows it is failing in your logging code. I tried to disable logging by the command line options, but it did not help.
The text was updated successfully, but these errors were encountered: