-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Don't mention installing Developer Pack on non-Windows OSes (MSB3644) #6647
Comments
Why require installing them at all, I experimented before when I used to explicitly reference that nuget package unconditionally when I multitargeted for .NET Standard, Framework, Core, and .NET 5 and it worked for me even without any devpacks for .NET Framework installed on MAC, Linux (VM), and a fresh Windows 10 install (thanks to the "start fresh" feature). |
Great question! They're still required if you're not using the .NET (Core) SDK -- so if you have older projects that won't automatically reference the ReferenceAssemblies package for you (or even can't reference it because they don't use NuGet at all). That's still a common Visual Studio-customer scenario, and should still get a nice error. |
True, but didn't most of them use nuget to download those packages to that project's folder though in that case (without directly referencing the packages in the non-SDK style projects) unless they created them themselves? What if the Dev packs came with the actual frameworks that is preinstalled with Windows's copy (.NET 4.8)? Would that fix that scenario as well? Assuming Windows 10 what could be added to what is preinstalled can be these:
But then again cant the frameworks older than 4.5 be rigged to use the 4.5 dev pack instead unless those older ones are installed by the user themselves? |
The default experience was
This was the case before .NET Framework 4.0 IIRC, but at some point the team decided to split the runtime and developer packs (presumably to reduce install footprint on non-developer machines).
Potentially, but it kinda doesn't matter: we're not going to service .NET Framework 4.8 with a change like this. .NET Core is the future of .NET, and this wouldn't meet the bar for a 4.8 change.
This actually used to be the behavior, but it caused some serious problems: #173. So: for a subset of users, the right response to this error is to install the developer pack from the link in the error. For them, we'd like to keep the error. For users on the latest SDKs, we should have a different error. |
So, basically have it trap if they are using the .NET SDK and if so have it not error and use those implicitly added reference assemblies packages unconditionally whenever it sees an .NET Framework TFM in the project's frameworks (like it does currently I think) without needing to install those dev packs otherwise it will error with it not being installed. |
Why not have a different error on non-Windows machines or update the existing message? Similar message but be generic and have a link point to a common resource for targeting .NET Framework using the .NET SDK!
|
No need to have that error on Non-windows at all. If they are using the .NET SDK then that means their projects must be sdk-style and that also means that the reference assemblies nuget package is implicitly referenced by the SDK for them. Or at least what I noticed so far whenever I target for example I think for non-windows OS's the proper thing to say (when they do not use SDK-style projects) is to port them to SDK-style for non-windows OS's (if they want to keep non-sdk style projects on Windows that is). |
That we can do. We can have the SDK props import the NuGet package implicitly but we'd also have to update the error message so that it won't confuse .NET devs on non-Windows platforms. |
It already does.
That's what this bug is for :) |
I see... So, what's the verdict on this? |
This bug asks for a change to the message and has been marked |
Can I? |
@Nirmal4G It's all yours. How do you plan to approach it? I can see a couple of options:
|
How about updating the error message as I mentioned above? Isn't that the simplest option? |
We want to leave the current error message when it's appropriate; it's been tweaked over time to be as informative as possible. |
I think the simplest fix is so: if (OperatingSystem.Windows)
{
// emit MSB3644.
}
else
{
// either emit nothing or something else.
} |
Let's try emitting a different error on non-Windows systems and then we'll see if we can merge those two messages. |
@Nirmal4G Any updates? |
Inspired by https://github.com/dotnet/core/issues/6419.
This message is reasonable for Windows scenarios, but since there are no .NET Framework Developer or Targeting Packs for Linux or macOS, we shouldn't mention them in that circumstance.
Not sure whether we should explicitly mention Microsoft.NETFramework.ReferenceAssemblies. The SDK should provide it for you so if you hit this on *nix it's likely an SDK bug.
The text was updated successfully, but these errors were encountered: