MSBuild: How to build web deploy package for Web Deployment Projects (VS2010)?
Solution 1
I answer on my one question. So after a lot of googling and 2 days of investigation it finally works.
Brief how to:
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
For information: If you need you can use standard Web Publishing parameters (e.g. ExcludeApp_Data, DeployIisAppPath etc.) in the QA configuration section.
Solution 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.
Related videos on Youtube
Roman Podlinov
I'm a senior full stack software developer / team lead (Javascript / React.js / Node.js / C#). I've been working onsite and remote on tech startups (mainly US based companies) for last 15 years. My areas of expertise: Javascript / Typescript / React.js / Jest Node.js / Express REST API / GraphQL C#, .Net Framework RDBMS: Postgresql, MySQL, MSSQL, Oracle NoSQL: MongoDB, Redis Docker for Linux and Windows Amazone Cloud / Azure Cloud CI/CD, Basic DevOps taks Linux In addition I have experience with high-load systems and optimization for frontend, backend & databases. The biggest high-load system I worked for had 20 millions of unique visitors per month. I also worked with: Amazon Web Services ASP.NET MVC Python PHP / Yii / Codeinsight Go Photon Engine TestCafe / Puppeteer Electron Apollo Server Rabbit MQ Websockets Jenkins / TeamCity / Bitbucket pipelines / Gitlab CI/CD / Github actions Accelerated Mobile Pages SAML 2.0 / oAuth 1, 2 / JWT Rancher etc Right now, I have the followng ranks on Stackoverflow: top 1% python, top 5% javascript, top 10% mysql node.js My LinkedIn: https://www.linkedin.com/in/romanpodlinov My Stackoverflow: https://stackoverflow.com/story/roman-podlinov My GitHUB: http://github.com/keepitsimple
Updated on May 25, 2022Comments
-
Roman Podlinov almost 2 years
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.
-
Roman Podlinov about 13 yearsI 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
-
Zach Bonham about 13 yearsahh, 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/…
-
Roman Podlinov about 13 yearsI found out that Web Deploy has Target=Package, but it didn't work for me until I made change #2 (see my answer).