【发布时间】:2021-11-15 23:22:10
【问题描述】:
我的 Web API project 在 Visual Studio 中构建良好。我试图使用下面的 yml 在 github 工作流中设置 CI。
name: web-api-ci-pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
runs-on: windows-latest
env:
SOLUTIONPATH: celt2/API/CELTAPI.sln
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Build code
run: dotnet build ${{env.SOLUTIONPATH}}
但是,在构建步骤中,我遇到了以下错误:
D:\a\CELT2\CELT2\celt2\API\CELTAPI\CELTAPI.csproj(153,3): 错误 MSB4019:导入的项目 “C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\5.0.401\Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets” 没有找到。确认 Import 声明中的表达式 “C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\5.0.401\Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets” 是正确的,并且该文件存在于磁盘上。
谁能指出我做错了什么?
【问题讨论】:
-
hm,我记得这个...很久以前,我想我有一个类似的问题,可以通过检查构建服务器上配置的 Visual Studio 构建工具是否正确来解决。我建议你检查一下。
标签: asp.net-web-api msbuild continuous-integration build-server