Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSBUILD : error MSB1009: Project file does not exist while building project on SonarQube server

I have a postbuild target in my csproj file, as below.

 <Target Name="PostBuild" AfterTargets="PostBuildEvent">
    <Exec Command="dotnet publish '..\..\src\httpapi\httpapi.csproj' -o $(OutputPath)\service"/>
  </Target>

Runs without any issues on my local machine, but fails with below error while building on sonarqube server.

MSBUILD : error MSB1009: Project file does not exist. 
- Switch: '..\..\src\httpapi\httpapi.csproj'

any idea why this happens? is there any other way I can mention the path to the target project in my post build target?

like image 428
nari447 Avatar asked Sep 18 '25 03:09

nari447


1 Answers

I had to to change below part to get this working

'..\..\src\httpapi\httpapi.csproj'

to

../../src/httpapi/httpapi.csproj

by removing quotes and changing the backward slash to forward slash..

like image 97
nari447 Avatar answered Sep 19 '25 18:09

nari447