托管 VS2017 不包含 .NET 4.6.0?
Hosted VS2017 doesn't include .NET 4.6.0?
我在 AzureDevops 中有一份 CI 工作通过(绿色)构建,目标是 .NET 4.6.1。它使用配置为 "Hosted VS2017".
的代理
如果我尝试将构建降级到 .NET4.6.0,我会收到此编译错误:
C:\Program Files (x86)\Microsoft Visual Studio17\Enterprise\MSBuild.0\Bin\Microsoft.Common.CurrentVersion.targets(1179,5): Error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
如何确保构建代理中安装了.NET 4.6.0 版本?我在 AzureDevOps-Pipelines 中找不到该选项。
已安装 100%。因为如果你打开 MS 用于代理 VS2017 的图像 image you will see 4.7.2 installed. And if you take a look for example which version of framework supported here 你会看到
Microsoft .NET Framework 4.7.2 is a highly compatible, in-place update
to .NET Framework 4, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, and
4.7.1.
这就是为什么我认为您可以在 MS 用于代理的图像 GitHub 中提问。
希望我的回答对您有所帮助
Azure DevOps 应该安装了所有 SDK 和目标包 AFAIK。
确保您在 csproj 中定位 net46
而 而不是 net460
。
我在 AzureDevops 中有一份 CI 工作通过(绿色)构建,目标是 .NET 4.6.1。它使用配置为 "Hosted VS2017".
的代理如果我尝试将构建降级到 .NET4.6.0,我会收到此编译错误:
C:\Program Files (x86)\Microsoft Visual Studio17\Enterprise\MSBuild.0\Bin\Microsoft.Common.CurrentVersion.targets(1179,5): Error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
如何确保构建代理中安装了.NET 4.6.0 版本?我在 AzureDevOps-Pipelines 中找不到该选项。
已安装 100%。因为如果你打开 MS 用于代理 VS2017 的图像 image you will see 4.7.2 installed. And if you take a look for example which version of framework supported here 你会看到
Microsoft .NET Framework 4.7.2 is a highly compatible, in-place update to .NET Framework 4, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, and 4.7.1.
这就是为什么我认为您可以在 MS 用于代理的图像 GitHub 中提问。
希望我的回答对您有所帮助
Azure DevOps 应该安装了所有 SDK 和目标包 AFAIK。
确保您在 csproj 中定位 net46
而 而不是 net460
。