msbuild DeployOnBuild=true 参数不起作用
msbuild DeployOnBuild=true argument not working
我正在尝试使用 DeplyOnBuild=true 参数自动发布我的 .NET 解决方案的所有项目(根据此 answer )
我在 PowerShell 中输入了这条命令:
msbuild mysolultion.sln /p:Configuration=Debug;DeployOnBuild=true;
但我收到以下错误消息:
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
我不确定我做错了什么。
PowerShell 将第一个分号后的所有内容解释为单独的命令。
您需要使用引号:
MSBuild example.sln /p:"Configuration=Debug;DeployOnBuild=true;"
或使用单独的/p
参数:
MSBuild example.sln /p:Configuration=Debug /p:DeployOnBuild=true
我正在尝试使用 DeplyOnBuild=true 参数自动发布我的 .NET 解决方案的所有项目(根据此 answer )
我在 PowerShell 中输入了这条命令:
msbuild mysolultion.sln /p:Configuration=Debug;DeployOnBuild=true;
但我收到以下错误消息:
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
我不确定我做错了什么。
PowerShell 将第一个分号后的所有内容解释为单独的命令。
您需要使用引号:
MSBuild example.sln /p:"Configuration=Debug;DeployOnBuild=true;"
或使用单独的/p
参数:
MSBuild example.sln /p:Configuration=Debug /p:DeployOnBuild=true