MSBuild: How to build web deploy package for Web Deployment Projects (VS2010)?

混江龙づ霸主 提交于 2020-01-01 04:40:28

问题


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.


回答1:


I answer on my one question. So after a lot of googling and 2 days of investigation it finally works.

Brief how to:

  1. I created Configuration = QA (based on Debug configuration) for Solution via Configuration Manager.

  2. 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>
    
  3. I build and package .wbproj file with the following command:

    msbuild WebSite.Deploy.wdproj /t:Build;Package /p:Configuration=QA
    

For information: If you need you can use standard Web Publishing parameters (e.g. ExcludeApp_Data, DeployIisAppPath etc.) in the QA configuration section.




回答2:


Try

MSBuild YourProject.csproj /T:Package

That should generate a deployment package. This page, How to: Use MSBuild to Create a Web Package might give a bit more information, but not much.



来源:https://stackoverflow.com/questions/5357871/msbuild-how-to-build-web-deploy-package-for-web-deployment-projects-vs2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!