MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.


Question: How do you resolve the error "MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file."



Login to See the Rest of the Answer

Answer: if you have just upgraded Visual Studio to the latest build, and then running dotnet watch run, this error shows up. 

To resolve this, delete the ProjectName.sln file. There is a chance the SLN file name is different from the Solution Name.
If the above cannot resolve the issue, do not use "watch" when running dotnet, simply type "dotnet run".


MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.

Edited Version 2
This error message is indicating that the MSBuild tool cannot determine which project or solution file to use because there are multiple files in the current directory. To resolve this issue, you can specify the project or solution file by providing its full path or using the "-Project" or "-Solution" option followed by the name of the file. For example

css msbuild /path/to/project.csproj
or
css msbuild -Project MyProject.csproj
If you are building a solution, you can use the "-Solution" option followed by the name of the solution file

css msbuild -Solution MySolution.sln




For peering opportunity Autonomouse System Number: AS401345 Custom Software Development at ErnesTech Email AddressContact: [email protected]