MSBUILD : error MSB1009: Project file does not exist. means the path you gave dotnet build does not point at a file that exists, relative to the folder you are in. The line under it, Switch:, shows the exact path it tried.

Compare the Switch: value with the real file name, letter by letter, and with your current folder. Correct the path, or pass the project's folder instead of the file and let the SDK find the .csproj inside it.

The error

MSBUILD : error MSB1009: Project file does not exist.
Switch: PathLab\PathLb.csproj

Why it happens

The argument after dotnet build is handed to MSBuild as the project to load. MSBuild looked for it relative to the current folder and stopped at once when nothing was there; no restore line was printed. In the test the file was PathLab.csproj and the command said PathLb.csproj: one missing letter. The Switch: line repeated the path exactly as it was typed, so the typo was visible in the output itself; reading that line first saves a search through the project for a problem that is only in the command.

Other commands word it differently. dotnet run --project PathLab\PathLab, with the extension left off, answered The provided file path does not exist: PathLab\PathLab. instead of MSB1009. Both say the same thing: the path in your command does not match a file on disk.

The fix

Get-ChildItem PathLab -Filter *.csproj | % Name
dotnet build PathLab\PathLab.csproj
dotnet build PathLab

Listing the folder showed the real name, PathLab.csproj. Both builds then reported 0 errors: one with the corrected file name, one with only the folder name. Passing the folder is the more forgiving form, because the SDK found the project file inside it by itself.

How it was reproduced

A dotnet new console -n PathLab -o PathLab project on .NET SDK 10.0.403, built from the parent folder in Windows PowerShell 5.1 with the file name mistyped as PathLb.csproj. In the PowerShell capture of the dotnet run error, PowerShell added its own dotnet : prefix and error-record lines around the message; the message itself is as quoted.

Frequently asked

What does MSB1009 project file does not exist mean?
The path given to dotnet build does not point at an existing file from the current folder. The Switch line under the error shows the path MSBuild tried.
How do I fix MSB1009 in dotnet build?
Check the file name and your current folder, then pass the correct path to the csproj, or pass the project folder and let the SDK find the project file in it.
Why does dotnet run say the provided file path does not exist?
It is dotnet run's wording for the same problem: the --project path does not match a file or folder on disk. Correct the path or point it at the project folder.

More decoded errors in the Fixes category. For a folder with no project at all, the related error is dotnet ef: No project was found.