我第一次修补 AzureDevops,设置一些 CI 任务。
我有一个公共(public)存储库(开源)和一个包含 3 个 F# 项目的解决方案(.sln)。该解决方案在 Windows/Mac/Linux 中构建良好。
但是,如果我尝试使用 Azure Devops Pipelines 设置构建管道,则会收到错误消息:
src\GWallet.Backend\GWallet.Backend.fsproj(0,0): Error MSB4057: The target "Build" does not exist in the project.
Logs here.
我怀疑被分配执行此操作的构建代理没有安装 F# 工具。因为我猜目标“Build”是在著名的
Microsoft.FSharp.Targets
中定义的。文件。如何配置 Windows(VS2017) 构建代理以安装 F# 工具,以便可以发现此文件?
最佳答案
@nosami 提出了一个解决方法,我对此不太满意(即:我仍然认为 AzureDevops 团队应该修复他们的默认托管代理以包含 F# 工具),但确实有效:使用 Microsoft.FSharp.Targets
由 nuget 包提供的名为 FSharp.Compiler.Tools
的文件. This is the diff如果你好奇的话,在我的开源项目中。
更新 :如果以上内容对您没有帮助或看起来过于复杂,我认为这两个答案之一可能有效:adjusting MSBuild properties of your project或 using the proper version of MSBuild也可以工作,而且更简单。
关于f# - 如何使用 Azure Devops Pipelines 构建 F# 项目?我收到错误 'The target "构建“项目中不存在”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52418705/