Skip to main content
 首页 » 编程设计

c#之使用 msbuild 命令行转换 web.config

2024年02月04日34shihaiming

希望设置 jenkins 来部署我正在使用脚本的网络应用程序

msbuild WEB.csproj /p:Configuration=stage /t:Build /p:PrecompileBeforePublish=true /p:OutputPath=c:\test /p:DeployOnBuild=true /p:AutoParameterizationWebConfigConnectionStrings=False 

我在 _PublishedWebsite 中获取了 Web 应用程序,但是 web.config 需要进行转换。有什么建议吗?

请您参考如下方法:

来自这篇文章TFS 2012 not copying transformed Web.Config to _PublishedWebsite

在命令中添加 /p:UseWPP_CopyWebApplication=true/p:PipelineDependsOnBuild=false 解决了问题