nari447
nari447

Reputation: 934

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?

Upvotes: 4

Views: 37652

Answers (1)

nari447
nari447

Reputation: 934

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..

Upvotes: 9

Related Questions