Using MSBuild, can I sign an application where the

2019-07-09 14:26发布

问题:

When I sign an application, I typically run a command line instruction like this:

msbuild /p:project=whatever;platform=all;configuration=sign;KeyFile=key.pfx;Password=pass;RunCodeAnalysis=false;StyleCopEnabled=false

Instead of specifying the password on the command line, is there an MSBuild property that lets me specify a file that contains the password? If not, is there any recommended procedure for signing, where the password is specified indirectly?

回答1:

If you can use BAT/CMD files instead of directly calling MSBuild:

You can insert content of the file into line that calls MSBuild using set /p

set /p MyPassword = <  path\to\file\Password.txt
msbuild ...;Password=%MyPassword%; 


标签: c# .net msbuild