Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article describes the MSB1011 error code.
Message text
MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.
Description
If no project or solution file is explicitly specified on the MSBuild.exe command-line, then the engine searches for a project or solution file by looking for *.*proj
or *.sln
(or *.slnx
with MSBuild 17.13 and later). MSBuild searches in the current directory, unless you specify a different working directory by passing a directory name on the command line.
It's not an error to have a folder with a solution file and a single project file with the same name. In that case, the solution file is used for the build. Similarly, if a solution file and multiple project files are found in the same folder, the solution is built. However, if only one project file is found, and it has a different name than a solution file in the same folder (not counting the file extension), then MSBuild issues this error.
Resolution
If you get this error because your solution contains one project, and the project has a different name than the solution, then MSBuild can't automatically find what you want to build. Instead, specify either the solution file or the project file explicitly on the command line.
Also, check the command line syntax for problems with special characters such as quotes and escape characters, or for issues with shell expansions and missing or undefined environment variables that could result in an empty string for the project or solution file.
Applies to
All versions of MSBuild