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

Bad error message when referencing a non-SDK multitargeting project #10629

Open
rainersigwald opened this issue Sep 7, 2024 · 0 comments
Open
Labels
Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. backlog Priority:3 Work that is nice to have triaged

Comments

@rainersigwald
Copy link
Member

Given a .NET Framework project (non-SDK) referenced by any project, (erroneously) add

	  <TargetFrameworks>net46;net8.0</TargetFrameworks>

to try to make it multitarget. That is ignored by the non-SDK common targets, so the individual project can build, but the referencing project fails before RPR, leaving you with

> msbuild -bl
  ClassLibrary2 succeeded (0.1s) → ClassLibrary2\bin\Debug\ClassLibrary2.dll
You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
  ClassLibrary2 failed with 1 error(s) (0.0s)
    C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(1967,5): error : Internal MSBuild error: Non-CrossTargeting GetTargetFrameworks target should not be used in cross targeting (outer) build

Build failed with 1 error(s) in 0.6s

That error isn't wrong but it sure doesn't help you fix the problem.

@rainersigwald rainersigwald added the Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. label Sep 7, 2024
@maridematte maridematte added backlog Priority:3 Work that is nice to have triaged labels Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. backlog Priority:3 Work that is nice to have triaged
Projects
None yet
Development

No branches or pull requests

2 participants