MSBuild:如何为Web部署项目(VS2010)构建Web部署程序包? [英] MSBuild: How to build web deploy package for Web Deployment Projects (VS2010)?
问题描述
我将一个Web站点项目(带有Web部署项目)从VS2008迁移到了VS2010.现在,我可以在VS2010中为Web部署项目制作构建部署包",并且效果很好!但是我找不到通过MSBuild进行相同操作的方法.
I migrated a Web Site project (with Web Deployment project) from VS2008 to VS2010. Now I can make "Build Deployment Package" for Web Deployment Project in VS2010 and it works great! But I can't find a way how to do the same via MSBuild.
推荐答案
我回答了一个问题.因此,经过大量的搜索和2天的调查,终于可以了.
I answer on my one question. So after a lot of googling and 2 days of investigation it finally works.
简要说明:
-
我通过Configuration Manager为解决方案创建了Configuration = QA(基于Debug配置).
I created Configuration = QA (based on Debug configuration) for Solution via Configuration Manager.
重要:我删除了质量检查配置的平台"参数.在完成之前,我无法构建软件包.(我的开发计算机是Win7-x64,但我不确定x86是否需要此步骤.但是我的构建服务器Win2008-x86对此很满意.修改.)这是我的.wdproj
Important: I removed 'Platform' parameter for QA Configuration. I couldn't build package until I did it. (My dev computer is Win7-x64, and I'm not not sure would be this step necessary for x86. But my build server Win2008-x86 forks fine with this modification.) This is QA Configuration section from my .wdproj
<PropertyGroup Condition=" '$(Configuration)' == 'QA' ">
<DebugSymbols>True</DebugSymbols>
<OutputPath>QA\</OutputPath>
<EnableUpdateable>true</EnableUpdateable>
<UseMerge>true</UseMerge>
<SingleAssemblyName>
</SingleAssemblyName>
<UseWebConfigReplacement>false</UseWebConfigReplacement>
<DeleteAppDataFolder>true</DeleteAppDataFolder>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<ExcludeApp_Data>true</ExcludeApp_Data>
</PropertyGroup>
我使用以下命令构建并打包.wbproj文件:
I build and package .wbproj file with the following command:
msbuild WebSite.Deploy.wdproj /t:Build;Package /p:Configuration=QA
有关信息:如果需要,可以在质量检查"配置部分中使用标准的Web发布参数(例如ExcludeApp_Data,DeployIisAppPath等).
For information: If you need you can use standard Web Publishing parameters (e.g. ExcludeApp_Data, DeployIisAppPath etc.) in the QA configuration section.
这篇关于MSBuild:如何为Web部署项目(VS2010)构建Web部署程序包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!