Description
Describe the bug
When building a multi-targeted exe where one target is net472
, referencing another exe and including xunit.v3 packages the following error will occur:
classlib net472 failed with 1 error(s) (0.0s)
C:\Program Files\dotnet\sdk\9.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1047: Assets file 'C:\Users\jaredpar\temp\example\classlib\obj\project.assets.json' doesn't have a target for 'net472/win-x86'. Ensure that restore has run and that you have included 'net472' in the TargetFrameworks for your project. You may also need to include 'win-x86' in your project's RuntimeIdentifiers.
To Reproduce
- Clone https://github.com/jaredpar/repro-build-win-x86-asset-error
- Run
dotnet build
Note: this error will go away if you explicitly add the following to classlib.csproj
<OutputType>Exe</OutputType>
This is actually done by the props file pulled in via xunit.v3 but apparently it's not early enough to head off whatever issue this is.