是的,那里有类似的问题,但它们与 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 任务。
关于azure - MSBuild 工具 2017 与 Azure SDK 2.9.6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42832371/