MSBuild "error MSB1009: Project file does not exist" in CI
MSBuild was given an explicit project or solution path that does not resolve to a file. MSB1009 is purely a path problem: a wrong working directory, a typo, or a file that was never checked out.
What this error means
dotnet build or msbuild fails with "MSBUILD : error MSB1009: Project file does not exist." and "Switch: MyApp.csproj" naming the missing file.
dotnet
MSBUILD : error MSB1009: Project file does not exist.
Switch: src/MyApp/MyApp.csprojCommon causes
Wrong working directory in the step
The build runs from a directory where the relative project path does not exist; the same path works from the repo root.
A typo or case mismatch in the path
The project name or folder is misspelled, or the case differs on a case-sensitive Linux runner.
How to fix it
Pass a path that exists from the step directory
- Confirm where the step runs and where the project file lives.
- Use a path relative to that directory, or set
working-directory. - Re-run the build.
.github/workflows/ci.yml
- run: dotnet build src/MyApp/MyApp.csproj
working-directory: ${{ github.workspace }}Match the exact filename and case
On Linux runners paths are case-sensitive; the file name must match exactly.
Terminal
ls src/MyApp/*.csproj
dotnet build src/MyApp/MyApp.csprojHow to prevent it
- Set an explicit
working-directoryfor build steps. - Match path case exactly for case-sensitive runners.
- Verify checkout includes the project before building.
Related guides
MSBuild "error MSB4019: imported project was not found" in CIFix "error MSB4019: The imported project X was not found" during dotnet build in CI - an Import in the projec…
MSBuild "error MSB4126: invalid solution configuration" in CIFix "error MSB4126: The specified solution configuration X is invalid" during dotnet build in CI - the Config…