Skip to content

Fix error message for non-Windows OS #12046

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Tasks/GetReferenceAssemblyPaths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ private IList<String> GetPaths(string rootPath, string targetFrameworkFallbackSe
{
// No reference assembly paths could be found, log an error so an invalid build will not be produced.
// 1/26/16: Note this was changed from a warning to an error (see GitHub #173).
if (pathsToReturn.Count == 0)
if (pathsToReturn.Count == 0 && NativeMethodsShared.IsWindows)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd still like to return an error in the non-Windows case. It just shouldn't reference installing Windows-only targeting packs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the right condition here IsWindows, or #if NET? Does the find-targeting-packs code work on Windows/net9?

{
// Fixes bad error message when an old SDK assumes "net50" means ".NETFramework 5.0" instead of "netcoreapp 5.0"
// https://github.com/dotnet/msbuild/issues/5820
Expand Down