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.

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

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.

3 Comments

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=Package
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/…
I found out that Web Deploy has Target=Package, but it didn't work for me until I made change #2 (see my answer).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.