Reputation: 747
I am trying to automatically publish all the projects of my .NET solution using the DeplyOnBuild=true argument (according to this answer )
I typed this command in the PowerShell:
msbuild mysolultion.sln /p:Configuration=Debug;DeployOnBuild=true;
But I get the following error message :
The term 'DeployOnBuild=true' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:59 + msbuild mysolution.sln /p:Configuration=Debug;DeployOnBuild=true <<<< ; + CategoryInfo : ObjectNotFound: (DeployOnBuild=true:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
I am not sure what I am doing wrong.
Upvotes: 0
Views: 1600
Reputation: 1604
PowerShell is interpreting everything after your first semicolon as a separate command.
You need to use quotes:
MSBuild example.sln /p:"Configuration=Debug;DeployOnBuild=true;"
Or use separate /p
parameters:
MSBuild example.sln /p:Configuration=Debug /p:DeployOnBuild=true
Upvotes: 4