我将一个带有Web Deployment项目的Web站点项目从VS2008迁移到了VS2010。现在我可以在VS2010中为Web Deployment项目创建“生成部署包”,并且它运行良好!但是我找不到通过MSBuild执行相同操作的方法。
我回答自己的问题。经过大量搜索和两天的调查,终于解决了问题。
简要说明如下:
I created Configuration = QA (based on Debug configuration) for Solution via Configuration Manager.
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>
I build and package .wbproj file with the following command:
msbuild WebSite.Deploy.wdproj /t:Build;Package /p:Configuration=QA
相关信息:如果需要,您可以在QA配置部分使用标准的Web发布参数(例如ExcludeApp_Data、DeployIisAppPath等)。