-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Priority:1Work that is critical for the release, but we could probably ship withoutWork that is critical for the release, but we could probably ship withouttriaged
Description
Issue Description
In certain situations, MSBuild might fail to correctly embed EmbeddedResource items with MSBuild 17.14 when NoBuild=true is specified.
The easiest way to get that behavior is by using PublishAot=true.
The culprit seems to be #10928.
After that PR, _GenerateCompileInputs does not add any EmbeddedResource to the inputs, see the attached binlog.
Steps to Reproduce
With the .NET SDK 9.0.306 / MSBuild 17.14:
- Clone https://github.com/MrJul/repro-publish-nobuild-bug (this is an almost empty console application with a single .resx file).
- Run
dotnet build -p:PublishAot=true - Run
dotnet publish -p:PublishAot=true -p:NoBuild=true - Run the published executable
- Notice it fails with a
MissingManifestResourceException
Reproducible with SDK versions 9.0.300 through 9.0.306, as well as 10.0.100-rc.2.25502.107.
It works without any issue with 9.0.205.
Expected Behavior
The executable has embedded resources and runs without any issue.
Actual Behavior
The executable doesn't have any embedded resources and fails at runtime.
Ask us questions
No response
Copilot
Metadata
Metadata
Assignees
Labels
Priority:1Work that is critical for the release, but we could probably ship withoutWork that is critical for the release, but we could probably ship withouttriaged