My web API project builds fine from Visual Studio. I was trying to setup the CI in the github workflows using below yml.
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}}
But, in the build step I am getting below error:
D:\a\CELT2\CELT2\celt2\API\CELTAPI\CELTAPI.csproj(153,3): error MSB4019: The imported project "C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\5.0.401\Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the expression in the Import declaration "C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\5.0.401\Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets" is correct, and that the file exists on disk.
Can anyone please point me out what am I doing wrong?