August 9, 2010
Blog ArchivesAn example of packaging web application containing database upgrade SQL file
A few months ago, we have a blog talking about extending the web publishing pipeline to package database project deployed SQL file. In this blog, I’ll show step by step example of packaging web application with SQL Server database upgrade SQL file using Visual Studio 2010. This way, we can generate a web package with incremental SQL script to certain database version. The scenario may help distributions of a web upgrade package which needs to be installed on many different locations, each with their own SQL server database. 1. Create a Web Application Project 2. Add a new “SQL Server 2008 Database Project” to the solution 3. Prepare a development database, such as my test1 database as the following: 4. Right click our…(read more)
A practical example of using web application deployment package with IIS7
When a zip package is built from VS2010 web application UI (via Build Deployment Package command), or through command line (msbuild myproject.csproj /t:package), a few files are generated in the destination folder. Here’s some brief description: File Name Description myApp.deploy-readme.txt Read me file of how to use myApp.deploy.cmd. myApp.deploy.cmd The auto generated command file which can be used in many situations. Check MSDN topic for details. myApp.SetParameters.xml The parameter file that user can modify to affect deployed IIS application, such as IIS application name, connection string etc. Check MSDN topic for more details. myApp.SourceManifest.xml The source manifest file that VS uses to compile the package via web deploy…(read more)
Tip #105: Did you know … How to include empty directory when package a web application?
By design, Visual Studio 2010 will skip the empty directory when packaging web application project using web deploy. To get empty directory packaged and deployed, we can work around this by adding an empty stub file inside the directory to make…(read more)
Extending the Web Publishing Pipeline to package database project deployed SQL file
A Visual Studio solution file may contain both database project and a web application project. When deploying (not building) the database project, it can generate a .sql file containing the full sql file or an incremental upgrade file against a database. This blogs walkthrough one way to package database project generated sql file into the web application project’s package. This solution works for team build scenario as well. 1. Create a Web Application Project 2. Add 2 new “SQL Server 2008 Database Project” to the solution 3. In each of the database project, add a sample table and make sure build and deploy are successful. Check the deployed SQL directory %database project dir%\sql\%configuration%\ making sure…(read more)
How to package and deploy COM component
I’ll use a walkthrough example to show how to package a web application with speech API COM component using Visual Studio 2010. I wrote and tested the sample in Win7 x86 with IIS7.5, and packaged and manually installed to win2k3 x86 IIS6 (which only had 3.5 framework installed). 1. Create a C# 3.5 web application 2. Add COM reference to “Microsoft Speech Object Library” 3. In Default.aspx, add the following between <div> < asp : ScriptManager ID ="ScriptManager1" runat ="server"> </ asp : ScriptManager > < asp : UpdatePanel ID ="UpdatePanel1" runat ="server"> < ContentTemplate > < asp : TextBox ID ="TextBox1" runat ="server" Width ="274px">…(read more)
How to package COM component
If we want to package and deploy COM component for a web application only, we can simply reference them and change their “Copy Local” property to “True”. For example, we can do the following to package a MVC project from VS2010. Create a MVC project In its references, change the following three assemblies “Copy Local” property value to True. System.Web.Mvc System.Web.Routing System.Web.Abstractions You can multi-select them and set the value together. Right click the project node and select “Build Deployment Package” Examine the package, you will see the above assemblies' corresponding dll files are included in the package’s bin directory. Deploy the above package to a 4.0 site, no matter if the corresponding MVC runtime is…(read more)
How to extend target file to include registry settings for web project package
Web project package and deployment targets files are written with extensibility in mind. User can easily extend a property to include more functionalities in their package by using msbuild targets and properties. If we check the Microsoft.Web.Publishing.targets file under “%Program Files%\MSBuild\Microsoft\VisualStudio\v10.0\Web\”, we can see the following, which means if file $(WebPublishPipelineProjectName).wpp.targets exists in the project directory, we’ll import it automatically when build package or publish. <!– *************************************************************** –> <!– To allow the Team build to have custom setting for the Web Application project without change the project file –> <!– by default…(read more)