Skip to content
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

Restore error for exe that references exe #45557

Open
jaredpar opened this issue Dec 19, 2024 · 0 comments
Open

Restore error for exe that references exe #45557

jaredpar opened this issue Dec 19, 2024 · 0 comments
Labels
Area-NetSDK untriaged Request triage from a team member

Comments

@jaredpar
Copy link
Member

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

  1. Clone https://github.com/jaredpar/repro-build-win-x86-asset-error
  2. 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.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NetSDK untriaged Request triage from a team member labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NetSDK untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

1 participant