.net-core - Azure DevOps 管道“dotnet build”找不到项目
问题描述
我有一个存储库,除了自述文件和 azure-pipelines.yml YAML 之外,master 上什么都没有。在开发分支(我要构建和部署并安装 CI 的分支)上有三个文件夹,MVC、Test 和 Console,每个文件夹都包含一个项目(ASP.NET Core MVC 的 MVC 版本、.NET Core 控制台和 Xunit 测试项目)。我想dotnet restore
在 MVC 项目上运行和构建,但出现错误:
2019-02-08T15:09:20.9373945Z ##[section]Starting: CmdLine
2019-02-08T15:09:20.9468192Z ==============================================================================
2019-02-08T15:09:20.9468291Z Task : Command Line
2019-02-08T15:09:20.9468353Z Description : Run a command line script using cmd.exe on Windows and bash on macOS and Linux.
2019-02-08T15:09:20.9468441Z Version : 2.146.1
2019-02-08T15:09:20.9468490Z Author : Microsoft Corporation
2019-02-08T15:09:20.9468565Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735)
2019-02-08T15:09:20.9468629Z ==============================================================================
2019-02-08T15:09:22.4499876Z Generating script.
2019-02-08T15:09:22.5206191Z ##[command]"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\21484123-df40-47c7-9383-7f526daaa124.cmd""
2019-02-08T15:09:22.8173263Z MSBUILD : error MSB1009: Project file does not exist.
2019-02-08T15:09:22.8173430Z Switch: MVC
2019-02-08T15:09:23.1247189Z Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
2019-02-08T15:09:23.1308513Z Copyright (C) Microsoft Corporation. All rights reserved.
2019-02-08T15:09:23.1308642Z
2019-02-08T15:09:23.1308714Z MSBUILD : error MSB1009: Project file does not exist.
2019-02-08T15:09:23.1308801Z Switch: MVC
2019-02-08T15:09:23.2993350Z ##[error]Cmd.exe exited with code '1'.
2019-02-08T15:09:23.3158684Z ##[section]Finishing: CmdLine
master 中的 YAML 文件如下:
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- dev
- master
pool:
vmImage: 'vs2017-win2016'
#- task: DotNetCoreInstaller@0
# inputs:
# version: '2.2.103' # replace this value with the version that you need for your project
steps:
- script: |
dotnet restore MVC
dotnet build MVC
- task: PublishBuildArtifacts@1
- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
displayName: 'Run a multi-line script'
- task: PublishBuildArtifacts@1
有没有办法访问 MVC 的dotnet
命令?
解决方案
推荐阅读
- appium - 为 Appium 添加所需功能时遇到问题
- java - NetBeans 无法连接到(gitlab 存储库)的存储库
- python - firebase 中生成的字符串是什么?
- django - 为我所有的 Django ManyToManyField() 添加一个独特的“中介”模型
- pentaho - Pentaho 使用带有先前字段的 Excel 输入
- haproxy - HAProxy - 如果第一台机器返回 404,则从第二台机器提供 URL
- javascript - 从 servlet 中的 ajax 发布请求获取数据(图像 toDataUrl)
- pdf - 如何在 pdftk 中正确创建多语言元数据
- c# - 无需等待即可调用控制台应用程序
- jquery - 如何在 jQuery 中获取动态创建的输入的单选值