我在配置Azure DevOps Dotnet core构建过程时遇到了麻烦。
我有一个简单的dotnet core项目,我正在尝试在Azure DevOps环境中构建它。
该项目位于我的存储库中的子文件夹中,但我无法弄清楚如何指定管道应如何找到我的csproj文件。MSDN文档表明您可以指定它,但没有示例,并且我的所有尝试都会遇到错误。
使用标准dotnet CLI模板构建管道时,YAML创建为:
# ASP.NET Core
# Build and test ASP.NET Core web applications targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://learn.microsoft.com/vsts/pipelines/languages/dotnet-core
pool:
vmImage: 'Ubuntu 16.04'
variables:
buildConfiguration: 'Release'
steps:
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
然而,这遇到了错误:
MSBUILD : error MSB1003: Specify a project or solution file.
The current working directory does not contain a project or solution file.
以上链接的文档建议使用“任务”基础语法而不是脚本,并且我认为在文档中输入的顺序与列在下面的示例相同。