June 7, 2011
Blog ArchivesWalkthrough: deploy a web application with SQL CE 4.0 database to IIS host with SQL Server.
With VS2010 sp1, we added SQL CE 4.0 support. You can view more information about SQL CE 4.0 from the following sites: http://weblogs.asp.net/scottgu/archive/2010/06/30/new-embedded-database-support-with-asp-net.aspx http://blogs.msdn.com/b/webd…
Video on Web Deployment using Visual Studio 2010 and MSDeploy
Back in November I participated in Virtual Tech Days which is an online conference presented by Microsoft. In the session I discussed the enhancements to web deployment using Visual Studio 2010 and MSDeploy. Some of the topics which I covered includ: w…
ASP.NET Web Application: Publish/Package Tokenizing Parameters
Today I just saw a question posted on stackoverflow.com asking Why are some Web.config transforms tokenised into SetParameters.xml and others are not ? Let me give some background on this topic for those who are not aware of what the question is. With Visual Studio 2010 when you package your application using the Build Deployment Package context menu option, see image below. When build the package by default the package will be created in obj\{Configuration}\Package\{ProjectName}.zip where {Configuration} is the current build configuration, and {ProjectName} is the name of the project. So in this case I since I’m building with Debug and the project name is MvcApplication1 the package will be placed at obj\Debug\Package\MvcApplication1…(read more)
ASP.NET Web Projects: web.debug.config & web.release.config
DIsclaimer: You may experience some in-consistent behavior using this technique. If so please let us know. I have heard a lot of questions and confusion regarding web.debug.config and web.release.config. For example here is just one question on StackOverflow . The question states: Hello, I want to use the web.config transformation that works fine for publish also for debugging. When i publish a web app, visual studio automatically transforms the web.config based on my First let me explain, as I did to that question, the purpose of the files: web.config/web.debug.config/web.release.config. web.config This is the config file which developers should use locally. Ideally you should get this to be standardized. For instance you could use localhost…(read more)
Parameterization vs. Web.Config Transformation
I was recently asked about being able to change values of different variables like ConnectionStrings, Installation physical directory, app Settings etc during install time rather than build time, so I thought it might be worth while to de-mystify the concepts around Web.Config Transforms and Parameterization… Web.Config Transformation Geeks say Web.Config Transformation is a great feature of Web Deploy (aka MsDeploy), well the first part about being a great feature is true
but it is important to note that Web.Config Transformation is not a Web Deploy feature but it instead is a VS 2010 only feature. Web.Config Transformation is connected with Build configuration of MSBuild/VS/Team Build etc… Its XML transformation engine is wrapped…(read more)
Applying XDT magic to App.Config
For several weeks now people have been asking to be able to use the XML Document Transform (XDT) with App.Config files similar to what is available with Web.Config files in VS 2010… In all honesty there is no official/supported implementation of XDT for any other project type than Web Application Projects but the good news is that the basis of Web.Config Transformation resides in Web Publishing Pipeline (WPP) which are set of extensible tasks and targets hooked up to provide a great deployment story for Web Applications… Today, Ming (our senior dev on Visual Studio) and I decided to get together to give some love to App.Config file too… The below implementation is a crude way of getting XDT working into other project types within VS 2010…(read more)
The Aspnet Compiler Build Task in Visual Studio 2010 ASP.Net MVC 2 Projects
If you crack open the project file in an ASP.Net MVC 2 application (in notepad or unload your project and then click “ Edit *.proj” ), you will notice an interesting line. <MvcBuildViews>false</MvcBuildViews> This is an option to enable a post build task that will run the Asp_net compiler. This command will compile your aspx pages and report any errors in the pages at design time. Ordinarily the compiler runs before your site loads for the first time after making a change. This is why you can debug a website or web application with errors in the markup and not see an error until actually running your site. So why is the option set to false by default? I obviously want errors at design time before I run the site! Well, if you turn…(read more)
Xml Document Transforms (XDT) for any XML file in your project
There have been several requests floating around to be able to use XDTs (the technology behind Web.Debug.Config/Web.Release.Config) with other XML files within the project… To make that feasible I wrote a XmlDocumentTransform.targets file which can generically transform any XML file using the standard Web.Config Transformation syntax introduced with VS 2010… Learn more about XDT & Web.Config Transformation here… Now to get started first download XmlDocumentTransform.targets file from my Skydive… Follow the below simple steps to get transformation working for any well formed XML file in your project… Step 1: Save the downloaded XmlDocumentTransform.targets to %ProgramFiles%\MSBuild\Microsoft\VisualStudio\v10.0\Web\XmlDocumentTransform…(read more)
Xml Document Transform (XDT) Snippets for VS 2010
During my PDC talk I had shown some of the snippets that can come handy while using Web.Config Transformations… This post is intended to share the XDT snippets and instructions on how to install them to use them with VS 2010… Download XDT zip file from my SkyDrive Unzip the files and copy the inner XDT folder into %Program Files%\Microsoft Visual Studio 10.0\Xml\1033\Snippets After this the XDT snippets will be available for you to use within any XML file within VS 2010… To know how to use XDTs for Web.Config file please check out the post about Web.Config Transformations Few interesting points about Transforms & Locators which are worth noting to do pretty powerful stuff with your XML are: Transforms – Transforms act on a XML…(read more)