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
Merged
Show file tree
Hide file tree
Changes from 2 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
11 changes: 10 additions & 1 deletion src/Tasks/GetReferenceAssemblyPaths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,16 @@ private IList<String> GetPaths(string rootPath, string targetFrameworkFallbackSe
// 1/26/16: Note this was changed from a warning to an error (see GitHub #173).
if (pathsToReturn.Count == 0)
{
Log.LogErrorWithCodeFromResources("GetReferenceAssemblyPaths.NoReferenceAssemblyDirectoryFound", frameworkmoniker.ToString());
// 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
if (frameworkmoniker.Identifier == ".NETFramework" && frameworkmoniker.Version.Major >= 5)
{
Log.LogErrorWithCodeFromResources("GetReferenceAssemblyPaths.OutOfDateSDK", frameworkmoniker.ToString());
}
else
{
Log.LogErrorWithCodeFromResources("GetReferenceAssemblyPaths.NoReferenceAssemblyDirectoryFound", frameworkmoniker.ToString());
}
}
}

Expand Down
9 changes: 8 additions & 1 deletion src/Tasks/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<comment>{StrBegin="MSB3961: "}</comment>
benvillalobos marked this conversation as resolved.
Show resolved Hide resolved
</data>

benvillalobos marked this conversation as resolved.
Show resolved Hide resolved

<!--
The WinMDExp task has the error buckets of MSB3762 - MSB3772
Expand Down Expand Up @@ -2832,6 +2836,8 @@
<value>MSB3954: Failed to compute hash for file '{0}' because it does not exist or is inaccessible.</value>
<comment>{StrBegin="MSB3954: "}</comment>
</data>

benvillalobos marked this conversation as resolved.
Show resolved Hide resolved

<!--
The tasks message bucket is: MSB3001 - MSB3999

Expand Down Expand Up @@ -2915,6 +2921,7 @@
MSB3931 - MSB3940 Task: Unzip
MSB3941 - MSB3950 Task: ZipDirectory
MSB3951 - MSB3960 Task: VerifyFileHash
MSB3961 - MSB3970 Task: GetReferenceAssemblyPaths overflow
benvillalobos marked this conversation as resolved.
Show resolved Hide resolved

MSB4000 - MSB4200 Portable targets & tasks (vsproject\flavors\portable\msbuild)
MSB9000 - MSB9900 MSBuild targets files (C++)
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Resources/xlf/Strings.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Tasks/Resources/xlf/Strings.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Tasks/Resources/xlf/Strings.en.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Tasks/Resources/xlf/Strings.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Tasks/Resources/xlf/Strings.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Tasks/Resources/xlf/Strings.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Tasks/Resources/xlf/Strings.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Tasks/Resources/xlf/Strings.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Tasks/Resources/xlf/Strings.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Tasks/Resources/xlf/Strings.pt-BR.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Tasks/Resources/xlf/Strings.ru.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Tasks/Resources/xlf/Strings.tr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Tasks/Resources/xlf/Strings.zh-Hans.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Tasks/Resources/xlf/Strings.zh-Hant.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.