Set Application Name in MSBuild Parameters

2019-04-26 16:12发布

I am deploying my web application from command line using this

msbuild WebApplication1.csproj /t:Package /p:configuration=release

It works fine, but the application deployed with the same name that is using in project settings page.

I want to set the name of deployed application using same command line. Is there any parameter in msbuild to do so or any other approach.

Thanks

3条回答
何必那么认真
2楼-- · 2019-04-26 16:26

I can't tell exactly what setting it is in the property pages that you are talking about however the syntax will be something like this:

msbuild WebApplication1.csproj /t:Package /p:configuration=release /p:appname=Test

查看更多
Ridiculous、
3楼-- · 2019-04-26 16:50

MS Build Command line parameters : it doesn't look like you can do it from the command line.

But you can do it in your config file - article using a property group

 <PropertyGroup>
     <appname>NewApplicationName</appname>
 </PropertyGroup>
查看更多
你好瞎i
4楼-- · 2019-04-26 16:51

You should try this

msbuild WebApplication1.csproj /t:Package /p:configuration=release;DeployIISAppPath="what_ever_name_you_want"

You could get more about these keywords in your project file(.csproj), open it in notepad and search for the default name that is setted by VS. and use that parameter in your command line.

Hope this helps.

查看更多
登录 后发表回答