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

Update 16.7 error message when trying to use net5.0 #5826

Merged
merged 7 commits into from
Oct 29, 2020

Conversation

benvillalobos
Copy link
Member

@benvillalobos benvillalobos commented Oct 22, 2020

Description

MSBuild currently gives a bad error message when using older .NET Core sdk's and targeting net5.0. The error message is not helpful so we want to update it for that specific scenario.

Customer Impact

Customers using an older SDK and targeting net5.0 currently receive an error that does not help their scenario. This PR fixes that message.

Risk

Low. We've acknowledged that this change will break legacy UWP projects that target netcore50, and are okay with that. The discussion for that is located here: #5833. Based on telemetry there seem to be somewhere between 1~4 users that would hit this scenario.

Code Reviewers

@Forgind
@rainersigwald

Description of fix

Change the error message when the discovered assembly is net5.0 and we're on an older SDK.


Fixes #5820

Resource Name: GetReferenceAssemblyPaths.OutOfDateSDK

Old bad message: The reference assemblies for {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

New good message (when targeting net5.0 and using an older SDK: The reference assemblies for "{0}" were not found. You might be using an older SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK.

src/Tasks/Resources/Strings.resx Outdated Show resolved Hide resolved
src/Tasks/GetReferenceAssemblyPaths.cs Outdated Show resolved Hide resolved
@@ -2160,7 +2160,11 @@
<value>MSB3645: .NET Framework v3.5 Service Pack 1 was not found. In order to target "{0}", .NET Framework v3.5 Service Pack 1 or later must be installed.</value>
<comment>{StrBegin="MSB3645: "}</comment>
</data>

<data name="GetReferenceAssemblyPaths.ReferenceAssemblyNotSupported">
<value>MSB3646: The discovered assembly "{0}" is not supported with this version of Visual Studio. To resolve this, retarget your application or update Visual Studio. You can download the latest version of Visual Studio at http://aka.ms/vsdownload</value>
Copy link
Member

Choose a reason for hiding this comment

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

NOTE: To get this in, we'd need a one-off localization pass for this new string. cc @wli3

src/Tasks/Resources/Strings.resx Outdated Show resolved Hide resolved
src/Tasks/Resources/Strings.resx Outdated Show resolved Hide resolved
@@ -2160,7 +2160,11 @@
<value>MSB3645: .NET Framework v3.5 Service Pack 1 was not found. In order to target "{0}", .NET Framework v3.5 Service Pack 1 or later must be installed.</value>
<comment>{StrBegin="MSB3645: "}</comment>
</data>

<data name="GetReferenceAssemblyPaths.OutOfDateSDK">
<value>MSB3961: The reference assemblies for "{0}" were not found. You might be using an older SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK.</value>
Copy link
Member

Choose a reason for hiding this comment

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

3961 is also in use.

Updating VS right now would mean updating to 16.7. They would have to switch to a preview version, right?

Copy link
Member

Choose a reason for hiding this comment

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

This will ship after or at best concurrently with 16.8.

Copy link
Member

Choose a reason for hiding this comment

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

Also, this is specifically for customers who are using 16.7 and building a project that targets 5.0. They are specifically not using 16.8 (preview or otherwise). They got the project from a coworker or retargeted themselves, etc. We already have customers reporting this who installed 5.0 previews on top of 16.7 and tried to make it work.

Copy link
Member

Choose a reason for hiding this comment

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

@KathleenDollard to review the string.

Copy link
Member

Choose a reason for hiding this comment

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

Just wanted to note that you can hit this with 16.8 if you global.json yourself down to a 3.1 or lower SDK.

src/Tasks/Resources/Strings.resx Outdated Show resolved Hide resolved
src/Tasks/Resources/Strings.resx Outdated Show resolved Hide resolved
Copy link
Member

@Forgind Forgind left a comment

Choose a reason for hiding this comment

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

LGTM!

@marcpopMSFT
Copy link
Member

marcpopMSFT commented Oct 28, 2020

Remember to update the version number to 16.7.2...never mind, looks like you already did.

@benvillalobos
Copy link
Member Author

The issue created to discuss the breaking change has been closed, as this fix does not impact that scenario. See here: #5833 (comment)

@benvillalobos
Copy link
Member Author

benvillalobos commented Oct 28, 2020

Note to self: This should not flow into the sdk. Need to change branding for December release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants