Edit

Share via


MSB1060 diagnostic code

This article describes the MSB1060 error code.

Message text

MSB1060: Specify one or more warning codes when using the -warnNotAsError switch. MSB1060: Undefined environment variable passed in as switch.

Description

There are two errors that can give this error code. The first relates to the -warnNotAsError (or the short form -noerr) command-line switch. See MSBuild command line reference. The error is shown when the -warnNotAsError (or -noerr) switch is used, but no error codes were given. The switch is expected to be followed by a list of error codes, separated by a semicolon or comma. For example:

msbuild.exe -err -noerr MSB3187;MSB3243

The other error condition that gives this code is when a response file (.rsp file) contains an environment variable name, but the environment variable didn't exist or has no value.

Resolution

If you saw the first of the two messages, heck the command line syntax around the option -warnNotAsError or -noerr and verify that there are no syntax errors, and that it has one or more error codes listed after it. If there is any shell expansion or environment variable that provides the list of codes, check that it has a value.

If you saw the second error message, use a response file for the MSBuild command line, validate the syntax, spelling, existence, and correct values of any environment variables referenced in the file. The correct syntax in the response file is shell-specific. For example, for cmd.exe the syntax is %ENVIRONMENT_VARIABLE%.

Note that the response file MSBuild.rsp is always used if present, regardless of whether you specify it on the command line. Also, Directory.Build.rsp is used, if present in the folders above the current folder.

Applies to

All versions of MSBuild