dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.7k stars 1.06k forks source link

Bad URL in missing targeting pack error message #11822

Open kg opened 4 years ago

kg commented 4 years ago

Description

If the targeting pack you need to build a project is missing when you try to build, the msbuild error message sends you to a URL to download developer packs but there aren't actually developer packs at that URL anymore.

Sample error message from an end user: /usr/local/share/dotnet/sdk/3.1.300/Microsoft.Common.CurrentVersion.targets(1177,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [/~snip~.csproj]

Unfortunately, https://aka.ms/msbuild/developerpacks is just a redirect to a page where you can download the .NET Core SDKs, so the URL doesn't point you to a solution for the problem. I couldn't actually find targeting pack downloads when I went looking, though my best guess is that in this case the user just needs the reference assemblies from https://github.com/Microsoft/dotnet/tree/master/releases/reference-assemblies which are available on NuGet. I have no idea how an ordinary human would figure that out though, and I'm not sure it's correct.

The old URL probably needs to be fixed to point to targeting packs again (I'm assuming that it ever did) and it might be good to update the error message to be a bit clearer since '.NET Framework Developer Packs' does not appear to be terminology anyone uses anymore.

ghost commented 4 years ago

Tagging subscribers to this area: @dotnet/ncl Notify danmosemsft if you want to be subscribed.

joeloff commented 4 years ago

@kg when you follow the link you should see the page below

image

If you click on the .NET Framework link, that will take you to a page that contains all the various versions and clicking on a specific version will then take you to a download page that includes the developer packs for that version, e.g. https://dotnet.microsoft.com/download/dotnet-framework/net471

kg commented 4 years ago

.NET Framework 4.7.1 appears to only be available for Windows on that download page. This error message is from .NET Core on Linux, not .NET Framework on Windows. Am I supposed to run the .NET installer using Wine?

joeloff commented 4 years ago

No, I wouldn't suggest that.

If you're building on Linux and need access to v4.0 references, I'd suggest using https://www.nuget.org/packages/Microsoft.NETFramework.ReferenceAssemblies/