System-supplied error message missing when PublishSingleFile & SelfContained #111783
Unanswered
JJLovesLife
asked this question in
Q&A
Replies: 1 comment 1 reply
-
It's not about mscorrc.dll. Managed resources are bundled with managed assembly. I can't reproduce this with SDK 9.0.102. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When run in normal build, this will show
Could not load file or assembly 'file.txt'. The system cannot find the file specified.
.The
Message
returns system-supplied error message becausenull
is pass to constructor.However, if you publish with
dotnet publish -p:PublishSingleFile=true -p:SelfContained=true
, then run the published exe file. You got empty string, without enriched exception message from runtime resource.Seems it is caused by the mscorrc.dll missing when self-contained & single bundle. Is this expected?
Beta Was this translation helpful? Give feedback.
All reactions