Edit

Share via


MSB1008 diagnostic code

This article describes the MSB1008 error code.

Message text

MSB1008: Only one project can be specified.

Remarks

This error occurs when there's something wrong with the command line that caused MSBuild to not find the project file, or found more than one part of the command line that it tried to interpret as a project file.

You usually specify one and only one project file on the command line. If you specify more than one, this error occurs.

Resolution

In command-line builds, check the syntax carefully for misplaced quotes, or escape characters such as backslashes. This error can occur if the command line syntax is incorrect.

Refer to the following documentation for certain command shells to see how they handle quotes and special characters:

The basic syntax for the MSBuild command line is MSBuild.exe [switches] [project file]. Check each part of the command line, and all the switches against the expected syntax as documented at MSBuild command line reference.

Applies to

All versions of MSBuild