-
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
Make GenerateResource look up resgen.exe in 10.0 SDK #6336
Conversation
GenerateResource tests were failing when only VS 2019 and 10.0 Windows SDK is installed. I suspect the task itself would also fail if run with ExecuteAsTool. The problem is that we started look up with .NET 4.6.1 and lower. Start lookup with .NET 4.8 instead and fallback down the chain. This should still find all earlier SDKs too. Introduce latest versions of Visual Studio too.
src/Utilities/ToolLocationHelper.cs
Outdated
@@ -109,7 +109,7 @@ public enum TargetDotNetFrameworkVersion | |||
/// breaking change. Use 'Latest' if possible, but note the | |||
/// compatibility implications. | |||
/// </summary> | |||
VersionLatest = Version462, | |||
VersionLatest = Version48, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good except this. I'm not sure it should change in a minor update for compatibility reasons. But I'm only saying that as the author of that comment that says not to, not that I remember why not :(.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC it's because enum values get baked into calling assemblies and we wanted it to be possible to use VersionLatest
and compile against the latest MSBuild while still running on an earlier patch. Especially given AzDO/GitHub silent VS version updates that still seems like a good conservative policy.
Version47 = 11, | ||
Version471 = 12, | ||
Version472 = 13, | ||
Version48 = 14, | ||
VersionLatest = 14, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC this is also something that shouldn't change mid-major-version.
// VS16 | ||
{ (dotNetFrameworkVersion451, visualStudioVersion160), (dotNetFrameworkVersion45, visualStudioVersion160) }, | ||
{ (dotNetFrameworkVersion452, visualStudioVersion160), (dotNetFrameworkVersion451, visualStudioVersion160) }, | ||
{ (dotNetFrameworkVersion46, visualStudioVersion160), (dotNetFrameworkVersion451, visualStudioVersion160) }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This matches above. But do we know why it's not falling back to 452?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't :)
src/Utilities/ToolLocationHelper.cs
Outdated
@@ -109,7 +109,7 @@ public enum TargetDotNetFrameworkVersion | |||
/// breaking change. Use 'Latest' if possible, but note the | |||
/// compatibility implications. | |||
/// </summary> | |||
VersionLatest = Version462, | |||
VersionLatest = Version48, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC it's because enum values get baked into calling assemblies and we wanted it to be possible to use VersionLatest
and compile against the latest MSBuild while still running on an earlier patch. Especially given AzDO/GitHub silent VS version updates that still seems like a good conservative policy.
@@ -1065,13 +1065,14 @@ private bool ComputePathToResGen() | |||
|
|||
if (String.IsNullOrEmpty(_sdkToolsPath)) | |||
{ | |||
_resgenPath = ToolLocationHelper.GetPathToDotNetFrameworkSdkFile("resgen.exe", TargetDotNetFrameworkVersion.Version35); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This being specifically 3.5 makes me a bit nervous. Was it just never changed and usually overridden from project logic, so we never noticed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out we need to leave Version35 here. I've added a comment explaining what is going on.
This actually fixes the unit-tests on a machine with only SDK 10.0 installed.
Turns out, this commit alone is what fixes the unit-tests for me: Technically we don't need the first two commits but if I've done the work anyway, I suppose let's keep them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Version160, | ||
|
||
/// <summary> | ||
/// Visual Studio "Dev17" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Visual Studio "Dev17" | |
/// Visual Studio 2022 "Dev17" |
nit 😉
GenerateResource tests were failing when only VS 2019 and 10.0 Windows SDK is installed. I suspect the task itself would also fail if run with ExecuteAsTool.
The problem is that we started look up with .NET 4.6.1 and lower. Start lookup with .NET 4.8 instead and fallback down the chain. This should still find all earlier SDKs too.
Introduce latest versions of Visual Studio too.
Fixes #6266