azure - MSBuild 工具 2017 与 Azure SDK 2.9.6

标签 azure msbuild visual-studio-2017

是的,那里有类似的问题,但它们与 VS 2017 无关:

我最近从 VS 2015 升级到 VS 2017。在我的本地开发计算机上,一切正常,Azure 应用程序(使用 Azure SDK 2.9.6)构建并启动。

但是在 TeamCity 服务器(MS Build Tools 2017 - 工具版本 15.0)上,我收到以下错误:

MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\Windows Azure Tools\2.9\Microsoft.WindowsAzure.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

构建服务器/MSBuild尝试在目录中查找Microsoft.WindowsAzure.targets:

“C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\Windows Azure Tools\2.9\

但它实际上在目录中:

“C:\Program Files (x86)\Microsoft Visual Studio\2017\[VisualStudioVersion]\MSBuild\Microsoft\VisualStudio\v15.0\Windows Azure Tools\2.9\

[VisualStudioVersion] 可以具有以下值“Community”、“Professional”、“Enterprise”

是的,我已经安装了构建工具 ( https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15 )。

是的,我已经将整个 Windows Azure Tools 文件夹复制到 BuildTools\MSBuild\Microsoft\VisualStudio\v15.0,但随后我的 F# 中出现另一个错误项目:

MSB4057: The target "GetTargetFrameworkProperties" does not exist in the project.

新的 MS Build Tools 2017 似乎无法在 Windows Azure 上正常工作。还有解决方法吗?或者是切换回旧版 MSBuild 的唯一选择?

最佳答案

新的独立 BuildTools 目前不支持 Windows Azure 目标。 因此,如果您想将新的 MSBuild 2017 与 Azure SDK 一起使用,您必须在构建服务器上安装完整的 VS 2017 安装。

注意:您可能必须重新启动 TeamCity(代理)才能识别 MSBuild 路径。运行构建后,您可以在“参数”选项卡中看到使用的 MSBuild 路径:

MSBuildTools15.0_x64_Path:C:\Program Files (x86)\Microsoft Visual Studio\2017\[VS_VERSION]\MSBuild\15.0\bin\amd64 MSBuildTools15.0_x86_Path: C:\Program Files (x86)\Microsoft Visual Studio\2017\[VS_VERSION]\MSBuild\15.0\bin [VS_VERSION] 可以是社区专业企业

我仍然从 F# 项目中收到 GetTargetFrameworkProperties 错误,已通过添加标志解决了这个问题:

/p:VisualStudioVersion=15.0

到 MSBuild 任务。

有关更多信息,请参阅 https://github.com/Microsoft/msbuild/issues/1888

关于azure - MSBuild 工具 2017 与 Azure SDK 2.9.6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42832371/

相关文章:

c# - Visual Studio 远程调试 - 缺少 MSVCP140.dll

Azure KeyVault 客户端证书和服务主体续订

build - TFS 不可知的 MSBuild 脚本

c# - TFS 2010 msbuild 覆盖输出目录中引用库的不同版本

visual-studio-2017 - 从 privateregistry 检索 Visual Studio 2017(企业) key

oracle - (ORA-12154) 无法从 VS 2017 中迁移的 SSIS 项目连接到 tnsnames.ora 中的数据源

azure - 为 Azure 数据工厂服务设置灾难恢复

Azure Functions - 限制并行执行

c# - 使用动态 DocumentId 从 Azure Functions 访问 DocumentDb

.net - 如何使用 TFS Build 构建 VS2010 MakeFile 项目 (vcxproj)(无 VS 2010)