Tuesday, September 22, 2009

Overview Post for Web Deployment in VS 2010

In past few months I and my team have written several blog posts on VS 2010 Web Deployment features… In VS 2010 there was a lot of investment made in Web Deployment and over next few months we will be writing more on the subject…

Below is the list of all the posts for easy reference:

Overview of VS 2010 Web Deployment

Web Packaging (Put your web into a .zip file)

Web.Config Transformation (Change Web.Config files per deployment environment)

Database Deployment

Web Publishing (Push you web from one machine to another)

Tips & Tricks for Web Deployment


Hope you will enjoy the VS 2010 Web Deployment features…




Prodis a.k.a. Fernando Hamasaki de Amorim said...

Very usefull information.

Thank you.

Anonymous said...


Ricardo said...

This is great, thanks!

Anonymous said...

how does XBAP fit into all this?

Anonymous said...

XBAP are content files in the web project so they will be deployed just like that. the only trouble it might have is its config files are not transformable as web.config

Alice Thomas said...
This comment has been removed by the author.
Aria Kerry said...
This comment has been removed by the author.
louis said...

woo,Thank you share

Anonymous said...

Hi, I'm desperatly trying to make work what is described in the msdn doc regarding the naming of connectionString in the SQL publish tab (http://msdn.microsoft.com/en-us/library/dd576376.aspx)

"If you specify a database name that ends with "-Web.config" and you specify a transform for the same connection string, the transform is not used. The value that you enter in this field is used in the destination Web.config file."

So basically it says that when the name ends by "-Web.config" the content of the textbox destination connectionString should replace the value in the web.config (tranformation is by passed)

But id does not work... Any idea ?



anty said...

Uhmmm……great share

Seat Penny Auction said...

Thanks a lot for the sharing the links with us.

the said...

good work

Lowest Unique Bid said...

Nice efforts.

Penny Auction said...

great job

Penny Auction Bidding said...

Pretty nice post!!

Anonymous said...

Greetings I recently finished reading through your blog and I'm very impressed. I do have a couple questions for you personally however. Do you think you're thinking about doing a follow-up posting about this? Will you be going to keep bringing up-to-date as well? turbo fire Thanks

search engine optimisation hampshire said...

Fascinating... My cousin was searching this kind of info. He will be very happy when I give him your url. Thanks!

Unknown said...

Fantastic! Thanks for your great blog.

Maurice said...

No matter if you wrote this 2 years ago, THANKS a lot Vishal !! One of the best and clean MS Deploy i have ever read !
Thanks Dude !

saç ekimi said...

This is a really stupid question but what language does the script need to be in?

Vishal R Joshi said...

Hi Sac, which script are you referring to? Msdeploy has options to either write powershell script or even standard commandline.

Unknown said...

Visual Studio 2010 comes with .NET Framework 4 and supports developing applications targeting Windows 7.It supports IBM DB2 and Oracle databases, in addition to Microsoft SQL Server.It has integrated support for developing Microsoft Silverlight applications, including an interactive designer.Visual Studio 2010 offers several tools to make parallel programming simpler: in addition to the Parallel Extensions for the .NET Framework and the Parallel Patterns Library for native code, Visual Studio 2010 includes tools for debugging parallel applications. The new tools allow the visualization of parallel Tasks and their runtime stacks. Tools for profiling parallel applications can be used for visualization of thread wait-times and thread migrations across processor cores. Intel and Microsoft have jointly pledged support for a new Concurrency Runtime in Visual Studio 2010 and Intel has launched parallelism support in Parallel Studio as an add-on for Visual Studio.Paper Shredder

Sergio said...

Hello. First is first, just say that this is a great blog that has helped me a lot in my job. Great job.
Having said that, I have a doubt that you may be able to help me with. I am currently working in a deployment project and we have a situation in which we have to build & deploy multiple projects to multiple servers. (Project1-->server1; project2-->server2 & server3,...). We have accomplished this by implementing multiple builds, one for each project, but I was wondering if there was a way to automatise all this builds & deployments in one file, so we could do this by just one action. Any help would be greatly appreciated. Thank you!!

Vishal R Joshi said...

There is a wacky workaround to do this but it is not pretty. Here is what you can do.
Create build configurations per server and then right clicking and editing each project file and putting the settings in there (e.g. DeployOnBuild = True, ServiceUrl=XYZ etc - check out the Team Build post in the above list it has the list of properties). Then if you do a solution build in your Build server then this should work out fine.
I really do apologize that it is not as easy as it should be but we are working on making that happen in the future.

Barbara said...

Hi Vishal!

I have a solution that contains multiple web application. Thanks to you I have configured and successfully published each one of these app to my IIS7 web server by using the one click-publish feature.
I was wondering now if there is an automatic way to publish all of them at once. Like one publish action for the entire solution based in one publish profile. Do you know what would be the best approach to accomplish this task?

Thanks a lot!

Vishal R Joshi said...

Hi Barbara,
Glad to hear that you were able to setup one click publish for all of your projects. Unfortunately there is no solution level publish option within VS IDE now. We will be working on it for the future.
If you want to deploy via team build then you can configure deployment on each project within its project file (csproj or vbproj) and then have the solution build. That way as part of the solution build the respective projects will get deployed.
Hope this helps.

final year projects said...

Thanks for great info, keep sharing more and more...

Chat Sohbet said...

Thank you admin...

Nike free run plus said...

very nice posts!

Viktor Evdokimov said...

great set of links on msdeploy, however i have one question that realy bother me.
How msdeploy together with say database projects are inteneded to be used in advanced scenarious?
Say deployment of multi-tier web application ( several DBs, web services, several web app projects ) with versioning support , on demand and scheduled builds, automated unit and acceptance test runs etc.
Have you seen any established scenarious for cases like that , or if you need stuff alike , just forget about this new features like web transform etc and do it as before - integration server like cc.net/ teamcity etc with several target configuration etc.

Anonymous said...

Hi Vishal,

I have a solution which has 3 websites and 1 database project and 1 server project (SQL SERVER 2008). I am trying to deploy the build using TFS at solution level. I was able to perform the deploy on the IIS server using the following details:

· Projects To Build - When you have only one web application and class libraries then it is easier to just have the Project (CSProj or VBProj) to build as shown in my example above, but if you have bunch of projects which all need to built then you might have to go with Solution Build option (.SLN).

Deployment for Web Apps is feasible at both Solution as well as Project build level although when it comes to Solution Build then you might want to make sure that the properties you are passing at Solution level will apply to all the projects in the solution which might not always the outcome you desire. In that situation all these properties can be set within the .csproj or .vbproj files too. You can do that by unloading your project file and in the top section just add above properties as you like:

For e.g /p:DeployOnBuild=True can be added as True

I tried the same approach for the database project by changing the settings in the database project (Sample.Database.dbproj) but was not able to perform the deploy.

Can you please help me in details regarding how to perform the database automatic deployment using the TFS

Please let me know if you have any further queries on the above details.

Thanks & Regards,
Santosh Kumar Patro

Sayed Ibrahim Hashimi said...

@Santosh, I have put together a sample which may help you out. Just send me an email and I'll send it to you, my email is sayedha [AT]{Microsoft}-DOTcom-.

Vishal R Joshi said...

Hi Santosh,
DeployOnBuild property is honored only by MVC and Web Application Projects and not DB Projects. For DB Projects please follow the instructions at http://blogs.msdn.com/b/webdevtools/archive/2010/03/24/extending-the-web-publishing-pipeline-to-package-database-project-deployed-sql-file.aspx



Hope this helps

Anonymous said...

Hi Vishal,

Thanks a lot for your reply. I am able to deploy the database using TFS at solution level. I am using the following in the MSBuildArguments in the Process tab for the nightly build:

/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=False /p:MSDeployPublishMethod=WMSVC /p:Configuration=Dev /p:MSDeployServiceUrl="https://ServerName:8172/MsDeploy.axd" /p:UserName=UserName /p:Password=Password /p:AllowUntrustedCertificate=True /p:TargetConnectionString=ConnectionString Details /p:TargetDatabase=TargetDatbase /p:DeployToDatabase=True /p:DeployToScript=True

But with the above settings I am having two issues as mentioned below:
1. I want to restrict the deploy of database in case of schema change only. How can I do this can you please guide me regarding it?
2. Say for example for the First version V1.0 of the Application I was able to successfully deploy the database with all the master data required for the master tables. Now there is some data available in the tables. As the build that I have prepared is the nightly build so every night at certain time the build will be deployed to the database server. So in that case all the data that is created by the user will be deleted or persisted. Can you please let me know. If the data is going to be deleted then how can we restrict the deletion of user created data.

Please help me to resolve these above mentioned issues.

Thanks & Regards,
Santosh Kumar Patro

Vishal R Joshi said...

Hi Santosh, for what you are looking you need to be able to compare your v1 DB with your v2 DB and generate schema diff SQL Scripts. You can generate these using TS Data projects available in Visual Studio or alternatively using tools like RedGate.
You will then have to configure these projects to build before your web project and consume the output of these in your web project deployment from the build server.
Please find links to these posts in the DB Section above, in particularly reference the posts titled:
Extending Web Publishing Pipeline (WPP) to package SQL files generated by TS Data Projects
How to use VS Database Projects (TS Data/Data Dude) with VS 2010 Web Deployment
Hope this helps

Ricardo said...

I use these features in my web site and they really do make deployment almost a joy. Rather than having to psych myself up to do a release over a stiff drink, now I just click a button.

Briquette Machine said...

Can you please help me in details regarding how to perform the database automatic deployment using the TFS

Vishal R Joshi said...

Hi Briquette,
In the DB section of this there are posts which tell you how to configure DB deployments. Once you do those then they should work with TFS too.
Hope this helps!