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 MSB1001 error code.
Message text
MSB1001: Unknown switch.
Description
This error occurs when there's a problem with the MSBuild command line and a particular switch was not recognized.
Resolution
Check the syntax and spelling of the all the parts of the MSBuild or dotnet
command line. Compare to the output of msbuild -help
, or the MSBuild command line reference.
Pay particular attention to spaces in paths and filenames (these usually need quotes around the entire switch), unmatched quotes, and other special characters, such as backslashes, as these can affect the interpretation of the entire command line.
In build scripts, check that any environment variables or expansions used to construct the MSBuild command line have a defined value, are correct, and don't contain extraneous escape characters.
Applies to
All versions of MSBuild