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

2

11

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.

Cuddle answered 18/3, 2011 at 21:12 Comment(0)
C
11

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.

Cuddle answered 22/3, 2011 at 9:38 Comment(0)
A
1

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.

Agile answered 18/3, 2011 at 21:24 Comment(3)
I do not have .csproj. The site is a Web Site project and doesn't have project file at all (That's why I use a Web Deployment project). The web deployment project has extension .wdproj and do not understand Target=PackageCuddle
ahh, i missed that even though its right there in your question. I don't have any experience with web site projects and based on the comments from ScottGu's blog, it doesn't look like its supported? Thats kind of old, so I don't know how relative it is. weblogs.asp.net/scottgu/archive/2010/07/29/…Agile
I found out that Web Deploy has Target=Package, but it didn't work for me until I made change #2 (see my answer).Cuddle

© 2022 - 2024 — McMap. All rights reserved.