<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Sayed Ibrahim Hashimi - MSBuild, Web Deploy (MSDeploy), ASP.NET - asp.net</title>
    <link>http://sedodream.com/</link>
    <description>MSBuild, C#, Visual Studio and more</description>
    <language>en-us</language>
    <copyright>Sayed Ibrahim Hashimi</copyright>
    <lastBuildDate>Mon, 06 Aug 2012 21:16:47 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>sayed.hashimi@gmail.com</managingEditor>
    <webMaster>sayed.hashimi@gmail.com</webMaster>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=38173cb5-ee11-4244-895c-dacb46f36279</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,38173cb5-ee11-4244-895c-dacb46f36279.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,38173cb5-ee11-4244-895c-dacb46f36279.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=38173cb5-ee11-4244-895c-dacb46f36279</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The release of Visual Studio 2012 is <a href="http://blogs.msdn.com/b/somasegar/archive/2012/08/01/visual-studio-2012-and-net-4-5-complete.aspx">right
around the corner</a>. If you’ve been following our blog/twitter then you may know
that many of the Web related components of Visual Studio are now“out-of-band”, meaning
that we can update them independently of Visual Studio itself. Because of this we
are planning to ship updates a few times a year. We are currently in the process for
planning our first update for VS 2012 and we wanted to share some of the items that
we are planning to work on. We would like to get your feedback on these ideas to ensure
that we are doing the right things. If you have comments please do let us know. FYI
the updates that I describe below will be made available for both VS 2012 as well
as VS 2010.
</p>
        <h1>Website Project Updates
</h1>
        <p>
When you use Visual Studio there are two types of web projects you can create: a Web
Application Project (WAP, this includes MVC) and a Website Project (WSP). In VS 2012
we did a lot of work to update the publish experience for WAPs. When we set out for
these updates we planned to take these enhancements and make the available to Website
projects as well. As we progressed it became evident that we did not have the resources
to implement the features for both WAP and WSP in time for VS 2012. So we focused
on creating the right experience for WAPs and we also added an extensibility point
into WSP which will allow us to replace the existing publish dialog. The reason why
we focused on WAP first was because WAPs already have support for Web Deploy (MSDeploy)
based publishing as well as a formal build/publish process captured in MSBuild. WSP
does not have either of these so it would have taken more time to start with WSP.
</p>
        <p>
When VS 2012 is released the publish experience for WSP will be the same which was
available in VS2010 but we will have a release a few months after the release which
will bring all the publish goodness to Website Projects! This will include all the
features which are available to Web Application Projects including; the ability to
publish using. 
</p>
        <ul>
          <li>
Publishing methods MSDeploy / MSDeploy package / FTP / File System / FPSE 
</li>
          <li>
Ability to have multiple publish profiles, which can be stored in version control 
</li>
          <li>
Command line publishing 
</li>
          <li>
            <a href="http://msdn.microsoft.com/en-us/library/dd465326.aspx">web.config transforms</a>
          </li>
          <li>
Enabling Entity Framework CF migrations in web.config during publish 
</li>
          <li>
Incremental database schema publish 
</li>
          <li>
File preview 
</li>
          <li>
etc 
</li>
        </ul>
        <p>
Since both project systems will be using the exact same code whenever we add a feature
it will immediately be available to both. In today’s world they are two entirely different
code bases (<em>the WSP publishing experience is currently native code where as the
WAP publish dialog is managed</em>). This will allow us to maintain a consistent publish
experience and also enable us to deliver features more quickly.
</p>
        <p>
Since WSP does not have a “build” process you might be wondering how we are planning
to hook this all together since our entire publish pipeline is captured in MSBuild.
Here is a rough idea of what we are currently thinking. After you use the new publish
dialog to create a publish profile for the first time we will do a number of things:
</p>
        <ol>
          <li>
Create a new folder to contain needed artifacts 
<ol><li>
The folder may be in the root of the Website project, but we are considering placing
it somewhere outside as well 
</li><li>
The name of this folder is not yet finalized, but it could be something like _Publish
or _Project 
</li></ol></li>
          <li>
Create an MSBuild file for the Website in that folder, this will capture information
like; included files, references, properties to control publish process 
<ol><li>
The primary purpose of dropping this file is to facilitate command line publish scenarios,
without this we could publish from Visual Studio but not from the command line 
</li><li>
When you make changes in Visual Studio like adding a reference we will automatically
keep this file up to date 
</li></ol></li>
          <li>
Create the publish profile in that folder (<em>this is a .pubxml file</em>) 
</li>
          <li>
When the site is being published the working directory (i.e. obj\ folder) will be
outside the root of the website, most likely in the same folder which contains the
WSP root 
</li>
        </ol>
        <p>
After we have those things in place for the most part the publish dialog will be able
to treat both projects in the same way. These files will by default be stored in version
control and can be shared with other team members. Sensitive information such as the
MSDeploy password will be stored in another file and encrypted per-user/per-machine
in a .user file which is not checked in.
</p>
        <h1>Web Deployment Projects
</h1>
        <p>
A few months after Visual Studio 2005 shipped we released the first version of <a href="http://msdn.microsoft.com/en-us/library/aa479568.aspx">Web
Deployment Projects</a>, and we updated WDP for both VS 2008 and VS 2010 and released
them a few months after each of those releases as well. WDPs are used for a few different
scenarios including the following.
</p>
        <ol>
          <li>
Publishing a Website project using MSDeploy 
</li>
          <li>
Command line publish support 
</li>
          <li>
Customizing the publish process for a WAP 
</li>
          <li>
Running ASP.NET precompile/merge for a WSP or WAP 
</li>
        </ol>
        <p>
When we looked at the scenarios that WDPs are typically used for and then compared
that to features which we have for WAP and WSP (<em>after the updates mentioned above</em>)
we noticed that most (<em>if not all</em>) scenarios where WDP is used can be covered
without requiring a WDP. Our new publish experience already has first class support
for MSDeploy, command line publishing, and for extensibility so that covers #1-#3.
Regarding #4 for WAPs we have already added ASP.NET precompile/merge as a publish
option (<em>you can find it in the Package/Publish Web tab</em>). Since WSP does not
have any property pages we are likely to move that option to being on the publish
dialog itself or we will expose those options in another way for WSP. We have not
yet settled on that design.
</p>
        <p>
It may not seem like it but updating WDP to support VS2012 is a <strong>significant
effort</strong>. Knowing that, and that most of the scenarios where WDP are used can
now be transitioned to the new experience, we have decided to invest in giving WSP
projects first class publishing support instead of updating VS 2012 to support WDP.
We think that this is the right decision because we are unifying the publish experience
for both project systems and it allows us to create a deeper set of features going
forward instead of investing in different things and wasting effort. If you have a
scenario that you think we have missed please do not hesitate to reach out to me by
email at <a href="mailto:sayedha@microsoft.com">sayedha@microsoft.com</a> and let
me know.
</p>
        <p>
          <br />
Sayed Ibrahim Hashimi | <a href="http://twitter.com/sayedihashimi">@SayedIHashimi</a></p>
      </body>
      <title>Plans regarding Website projects and Web Deployment Projects</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,38173cb5-ee11-4244-895c-dacb46f36279.aspx</guid>
      <link>http://sedodream.com/2012/08/06/PlansRegardingWebsiteProjectsAndWebDeploymentProjects.aspx</link>
      <pubDate>Mon, 06 Aug 2012 21:16:47 GMT</pubDate>
      <description>&lt;p&gt;
The release of Visual Studio 2012 is &lt;a href="http://blogs.msdn.com/b/somasegar/archive/2012/08/01/visual-studio-2012-and-net-4-5-complete.aspx"&gt;right
around the corner&lt;/a&gt;. If you’ve been following our blog/twitter then you may know
that many of the Web related components of Visual Studio are now“out-of-band”, meaning
that we can update them independently of Visual Studio itself. Because of this we
are planning to ship updates a few times a year. We are currently in the process for
planning our first update for VS 2012 and we wanted to share some of the items that
we are planning to work on. We would like to get your feedback on these ideas to ensure
that we are doing the right things. If you have comments please do let us know. FYI
the updates that I describe below will be made available for both VS 2012 as well
as VS 2010.
&lt;/p&gt;
&lt;h1&gt;Website Project Updates
&lt;/h1&gt;
&lt;p&gt;
When you use Visual Studio there are two types of web projects you can create: a Web
Application Project (WAP, this includes MVC) and a Website Project (WSP). In VS 2012
we did a lot of work to update the publish experience for WAPs. When we set out for
these updates we planned to take these enhancements and make the available to Website
projects as well. As we progressed it became evident that we did not have the resources
to implement the features for both WAP and WSP in time for VS 2012. So we focused
on creating the right experience for WAPs and we also added an extensibility point
into WSP which will allow us to replace the existing publish dialog. The reason why
we focused on WAP first was because WAPs already have support for Web Deploy (MSDeploy)
based publishing as well as a formal build/publish process captured in MSBuild. WSP
does not have either of these so it would have taken more time to start with WSP.
&lt;/p&gt;
&lt;p&gt;
When VS 2012 is released the publish experience for WSP will be the same which was
available in VS2010 but we will have a release a few months after the release which
will bring all the publish goodness to Website Projects! This will include all the
features which are available to Web Application Projects including; the ability to
publish using. 
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Publishing methods MSDeploy / MSDeploy package / FTP / File System / FPSE 
&lt;/li&gt;
&lt;li&gt;
Ability to have multiple publish profiles, which can be stored in version control 
&lt;/li&gt;
&lt;li&gt;
Command line publishing 
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://msdn.microsoft.com/en-us/library/dd465326.aspx"&gt;web.config transforms&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
Enabling Entity Framework CF migrations in web.config during publish 
&lt;/li&gt;
&lt;li&gt;
Incremental database schema publish 
&lt;/li&gt;
&lt;li&gt;
File preview 
&lt;/li&gt;
&lt;li&gt;
etc 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Since both project systems will be using the exact same code whenever we add a feature
it will immediately be available to both. In today’s world they are two entirely different
code bases (&lt;em&gt;the WSP publishing experience is currently native code where as the
WAP publish dialog is managed&lt;/em&gt;). This will allow us to maintain a consistent publish
experience and also enable us to deliver features more quickly.
&lt;/p&gt;
&lt;p&gt;
Since WSP does not have a “build” process you might be wondering how we are planning
to hook this all together since our entire publish pipeline is captured in MSBuild.
Here is a rough idea of what we are currently thinking. After you use the new publish
dialog to create a publish profile for the first time we will do a number of things:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Create a new folder to contain needed artifacts 
&lt;ol&gt;
&lt;li&gt;
The folder may be in the root of the Website project, but we are considering placing
it somewhere outside as well 
&lt;/li&gt;
&lt;li&gt;
The name of this folder is not yet finalized, but it could be something like _Publish
or _Project 
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
Create an MSBuild file for the Website in that folder, this will capture information
like; included files, references, properties to control publish process 
&lt;ol&gt;
&lt;li&gt;
The primary purpose of dropping this file is to facilitate command line publish scenarios,
without this we could publish from Visual Studio but not from the command line 
&lt;/li&gt;
&lt;li&gt;
When you make changes in Visual Studio like adding a reference we will automatically
keep this file up to date 
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
Create the publish profile in that folder (&lt;em&gt;this is a .pubxml file&lt;/em&gt;) 
&lt;/li&gt;
&lt;li&gt;
When the site is being published the working directory (i.e. obj\ folder) will be
outside the root of the website, most likely in the same folder which contains the
WSP root 
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
After we have those things in place for the most part the publish dialog will be able
to treat both projects in the same way. These files will by default be stored in version
control and can be shared with other team members. Sensitive information such as the
MSDeploy password will be stored in another file and encrypted per-user/per-machine
in a .user file which is not checked in.
&lt;/p&gt;
&lt;h1&gt;Web Deployment Projects
&lt;/h1&gt;
&lt;p&gt;
A few months after Visual Studio 2005 shipped we released the first version of &lt;a href="http://msdn.microsoft.com/en-us/library/aa479568.aspx"&gt;Web
Deployment Projects&lt;/a&gt;, and we updated WDP for both VS 2008 and VS 2010 and released
them a few months after each of those releases as well. WDPs are used for a few different
scenarios including the following.
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Publishing a Website project using MSDeploy 
&lt;/li&gt;
&lt;li&gt;
Command line publish support 
&lt;/li&gt;
&lt;li&gt;
Customizing the publish process for a WAP 
&lt;/li&gt;
&lt;li&gt;
Running ASP.NET precompile/merge for a WSP or WAP 
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
When we looked at the scenarios that WDPs are typically used for and then compared
that to features which we have for WAP and WSP (&lt;em&gt;after the updates mentioned above&lt;/em&gt;)
we noticed that most (&lt;em&gt;if not all&lt;/em&gt;) scenarios where WDP is used can be covered
without requiring a WDP. Our new publish experience already has first class support
for MSDeploy, command line publishing, and for extensibility so that covers #1-#3.
Regarding #4 for WAPs we have already added ASP.NET precompile/merge as a publish
option (&lt;em&gt;you can find it in the Package/Publish Web tab&lt;/em&gt;). Since WSP does not
have any property pages we are likely to move that option to being on the publish
dialog itself or we will expose those options in another way for WSP. We have not
yet settled on that design.
&lt;/p&gt;
&lt;p&gt;
It may not seem like it but updating WDP to support VS2012 is a &lt;strong&gt;significant
effort&lt;/strong&gt;. Knowing that, and that most of the scenarios where WDP are used can
now be transitioned to the new experience, we have decided to invest in giving WSP
projects first class publishing support instead of updating VS 2012 to support WDP.
We think that this is the right decision because we are unifying the publish experience
for both project systems and it allows us to create a deeper set of features going
forward instead of investing in different things and wasting effort. If you have a
scenario that you think we have missed please do not hesitate to reach out to me by
email at &lt;a href="mailto:sayedha@microsoft.com"&gt;sayedha@microsoft.com&lt;/a&gt; and let
me know.
&lt;/p&gt;
&lt;p&gt;
&lt;br /&gt;
Sayed Ibrahim Hashimi | &lt;a href="http://twitter.com/sayedihashimi"&gt;@SayedIHashimi&lt;/a&gt;
&lt;/p&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,38173cb5-ee11-4244-895c-dacb46f36279.aspx</comments>
      <category>asp.net</category>
      <category>MSDeploy</category>
      <category>Visual Studio</category>
      <category>Visual Studio 2010</category>
      <category>Visual Studio 2012</category>
      <category>Web Publishing Pipeline</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=055c7ccf-e6a9-41e7-bcb8-db3bc65194f2</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,055c7ccf-e6a9-41e7-bcb8-db3bc65194f2.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,055c7ccf-e6a9-41e7-bcb8-db3bc65194f2.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=055c7ccf-e6a9-41e7-bcb8-db3bc65194f2</wfw:commentRss>
      <slash:comments>5</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I have written a few posts recently describing out updated web publish experience.
These new experience is available for both Visual Studio 2010 as well as Visual Studio
2012 RC. You can use the links below to download these updates in the Azure SDK download.
Below are links for both versions.
</p>
        <ul>
          <li>
            <a href="http://go.microsoft.com/fwlink/?LinkID=254269&amp;clcid=0x409">Windows Azure
SDK for Visual Studio 2010</a>
          </li>
          <li>
            <a href="http://go.microsoft.com/fwlink/?LinkId=254364&amp;clcid=0x409">Windows Azure
SDK for Visual Studio 2012 RC</a>
          </li>
        </ul>
        <p>
The Web Publish experience is chained into VS 2012 RC so if you have installed VS
2012 RC with the Web features then you already have these features.
</p>
        <p>
Thanks, 
<br />
Sayed Ibrahim Hashimi <a href="https://twitter.com/#!/sayedihashimi">@SayedIHashimi</a></p>
      </body>
      <title>Downloading the Visual Studio Web Publish Updates</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,055c7ccf-e6a9-41e7-bcb8-db3bc65194f2.aspx</guid>
      <link>http://sedodream.com/2012/06/15/DownloadingTheVisualStudioWebPublishUpdates.aspx</link>
      <pubDate>Fri, 15 Jun 2012 19:30:40 GMT</pubDate>
      <description>&lt;p&gt;
I have written a few posts recently describing out updated web publish experience.
These new experience is available for both Visual Studio 2010 as well as Visual Studio
2012 RC. You can use the links below to download these updates in the Azure SDK download.
Below are links for both versions.
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://go.microsoft.com/fwlink/?LinkID=254269&amp;amp;clcid=0x409"&gt;Windows Azure
SDK for Visual Studio 2010&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://go.microsoft.com/fwlink/?LinkId=254364&amp;amp;clcid=0x409"&gt;Windows Azure
SDK for Visual Studio 2012 RC&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
The Web Publish experience is chained into VS 2012 RC so if you have installed VS
2012 RC with the Web features then you already have these features.
&lt;/p&gt;
&lt;p&gt;
Thanks, 
&lt;br /&gt;
Sayed Ibrahim Hashimi &lt;a href="https://twitter.com/#!/sayedihashimi"&gt;@SayedIHashimi&lt;/a&gt;
&lt;/p&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,055c7ccf-e6a9-41e7-bcb8-db3bc65194f2.aspx</comments>
      <category>asp.net</category>
      <category>Deployment</category>
      <category>Visual Studio</category>
      <category>Visual Studio 11</category>
      <category>Visual Studio 2010</category>
      <category>web</category>
      <category>Web Deployment Tool</category>
      <category>Web Publishing Pipeline</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=bfa8b339-0bf2-4d9c-995b-beaef0ce39ba</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,bfa8b339-0bf2-4d9c-995b-beaef0ce39ba.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,bfa8b339-0bf2-4d9c-995b-beaef0ce39ba.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=bfa8b339-0bf2-4d9c-995b-beaef0ce39ba</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Last week we rolled out some updates for our Visual Studio 2010 Web Publishing Experience.
This post will give you an overview of the new features which we released. In the
coming weeks there will be more posts getting into more details regarding individual
features. 
</p>
        <p>
You can get these updates in the <a href="http://go.microsoft.com/fwlink/?LinkID=254269&amp;clcid=0x409">Windows
Azure SDK for Visual Studio 2010</a>. When you download that package there you will
also get the latest tools for Azure development.
</p>
        <p>
The new high level features include the following.
</p>
        <ul>
          <li>
Updated Web Publish dialog 
</li>
          <li>
Support to import publish profiles (<em>.publishSettings files</em>) 
</li>
          <li>
Support to configure EF Code First migrations during publish 
</li>
          <li>
Support to create web packages in the publish dialog 
</li>
          <li>
Publish profiles now a part of the project and stored in version control by default 
</li>
          <li>
Publish profiles are now MSBuild files 
</li>
          <li>
Profile specific web.config transforms 
</li>
        </ul>
        <h1>Overview
</h1>
        <p>
When you right click on your Web Application Project (WAP) you will now see the new
publish dialog.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_4.png">
            <img style="background-image: none; display: inline" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_thumb_1.png" width="724" height="564" />
          </a>
        </p>
        <p>
On this tab you can import a .publishSettngs file, which many web hosts provide, and
you can also manage your publish profiles. If you are hosting your site on Windows
Azure Web Sites then you can download the publish profile on the dashboard of the
site using the <em>Download publish profile</em> link. After you import this publish
profile you will be brought to the Connection tab automatically.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_8.png">
            <img style="background-image: none; display: inline" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_thumb_3.png" width="724" height="564" />
          </a>
        </p>
        <p>
On this tab you can see all the server configuration values which are needed for your
client machine to connect to the server. Typically you don’t have to worry about the
details of these values. Next you’ll go to the Settings tab.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_10.png">
            <img style="background-image: none; display: inline" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_thumb_4.png" width="724" height="564" />
          </a>
        </p>
        <p>
On the Settings tab you can set the build configuration which should be used for the
publish process, the default value here is Release. There is also a checkbox to enable
you to delete any files on the server which do not exist in the project.
</p>
        <p>
Below that checkbox you will see a section for databases. The sample project shown
has an <a href="http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application">Entity
Framework</a> Code First model, named ContactsContext, and it uses <a href="http://msdn.microsoft.com/en-us/library/hh770484">Code
First Migrations</a> to manage the database schema. If you have any non-EF Code First
connection strings in web.config then those databases will show up as well but the
support for incrementally publishing the schema for those has not yet been finalized.
We are currently working on that. You can visit <a href="http://sedodream.com/2012/06/07/VSPublishDialogUpdateDatabaseDialogDisabled.aspx">my
previous blog entry</a> for more info on that.
</p>
        <p>
If you imported a .publishSettings file with a connection string then that connection
string would automatically be inserted in the textbox/dropdown for the connection
string. If you did not then you can use the … button to create a connection string
with the Connection String Builder dialog or you can simply type/paste in a connection
string. For the EF Code First contexts you will see the <em>Execute Code Frist Migrations</em> checkbox.
When you check this when your site is published the web.config will be transformed
to enable the Code First migrations to be executed the first time that the context
is accessed. Now you can move to the Preview tab.
</p>
        <p>
When you first come to the Preview tab you will see a Start Preview button. Once you
click this button you will see the file operations which would be performed once you
publish. Since this site has never been published all the file operations are Add,
as you can see in the image below. The other Action values include; Update and Delete.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_14.png">
            <img style="background-image: none; display: inline" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_thumb_6.png" width="724" height="564" />
          </a>
        </p>
        <p>
Once you are ready to publish you can click the Publish button. You can monitor the
progress of the publish process using the Output Window. If your publish profile had
a value for the Destination URL then the site will automatically be opened in the
default browser after the publish has successfully completed.
</p>
        <h1>Publish Profiles
</h1>
        <p>
One of the other changes in the publish experience is that publish profiles are now
stored as a part of your project. They are stored under the folder Properties\PublishProfiles
(<em>for VB projects its My Project\PublishProfiles</em>) and the extension is .pubxml.
You can see this in the image below.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_18.png">
            <img style="background-image: none; display: inline" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_thumb_8.png" width="330" height="475" />
          </a>
        </p>
        <p>
These .pubxml files are MSBuild files and you can modify these files in order to customize
the publish process. If you do not want the publish profile to be checked into version
control you can simply exclude it from the project. The publish dialog will look at
the files in the PublishProfiles folder so you will still be able to publish using
that profile. You can also leverage these publish profiles to simply publishing from
the command line. For example you can use the following syntax to publish from the
command line.
</p>
        <p>
msbuild.exe WebApplication2.csproj /p:DeployOnBuild=true;PublishProfile="pubdemo
- Web Deploy";Password={INSERT-PASSWORD}
</p>
        <p>
 
</p>
        <h1>Resources
</h1>
        <ul>
          <li>
            <a href="http://go.microsoft.com/fwlink/?LinkID=254269&amp;clcid=0x409">Windows Azure
SDK for Visual Studio 2010</a> (<em>this contains the new Web Publish experience</em>) 
</li>
          <li>
Tutorial: <a href="https://www.windowsazure.com/en-us/develop/net/tutorials/web-site-with-sql-database/">Deploying
an ASP.NET Web Application to a Windows Azure Web Site and SQL Database</a></li>
          <li>
            <a href="http://blogs.msdn.com/b/aspnetue/archive/2012/06/12/visual-studio-2012-rc-deployment-documentation-published.aspx">Visual
Studio 2012 RC Deployment Documentation Published</a> (<em>the publish experience
in VS2012 RC is nearly identical to the VS 2010 Web Publish updates</em>) 
</li>
          <li>
            <a href="http://sedodream.com/">Sayed’s blog</a>
          </li>
        </ul>
        <p>
If you have any questions please feel free to directly reach out to me at sayedha(at){MicrosoftDOTCom}.
</p>
        <p>
Sayed Ibrahim Hashimi <a href="https://twitter.com/#!/sayedihashimi">@SayedIHashimi</a></p>
      </body>
      <title>Visual Studio 2010 Web Publish Updates</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,bfa8b339-0bf2-4d9c-995b-beaef0ce39ba.aspx</guid>
      <link>http://sedodream.com/2012/06/15/VisualStudio2010WebPublishUpdates.aspx</link>
      <pubDate>Fri, 15 Jun 2012 19:07:30 GMT</pubDate>
      <description>&lt;p&gt;
Last week we rolled out some updates for our Visual Studio 2010 Web Publishing Experience.
This post will give you an overview of the new features which we released. In the
coming weeks there will be more posts getting into more details regarding individual
features. 
&lt;/p&gt;
&lt;p&gt;
You can get these updates in the &lt;a href="http://go.microsoft.com/fwlink/?LinkID=254269&amp;amp;clcid=0x409"&gt;Windows
Azure SDK for Visual Studio 2010&lt;/a&gt;. When you download that package there you will
also get the latest tools for Azure development.
&lt;/p&gt;
&lt;p&gt;
The new high level features include the following.
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Updated Web Publish dialog 
&lt;/li&gt;
&lt;li&gt;
Support to import publish profiles (&lt;em&gt;.publishSettings files&lt;/em&gt;) 
&lt;/li&gt;
&lt;li&gt;
Support to configure EF Code First migrations during publish 
&lt;/li&gt;
&lt;li&gt;
Support to create web packages in the publish dialog 
&lt;/li&gt;
&lt;li&gt;
Publish profiles now a part of the project and stored in version control by default 
&lt;/li&gt;
&lt;li&gt;
Publish profiles are now MSBuild files 
&lt;/li&gt;
&lt;li&gt;
Profile specific web.config transforms 
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Overview
&lt;/h1&gt;
&lt;p&gt;
When you right click on your Web Application Project (WAP) you will now see the new
publish dialog.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_4.png"&gt;&lt;img style="background-image: none; display: inline" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_thumb_1.png" width="724" height="564" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
On this tab you can import a .publishSettngs file, which many web hosts provide, and
you can also manage your publish profiles. If you are hosting your site on Windows
Azure Web Sites then you can download the publish profile on the dashboard of the
site using the &lt;em&gt;Download publish profile&lt;/em&gt; link. After you import this publish
profile you will be brought to the Connection tab automatically.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_8.png"&gt;&lt;img style="background-image: none; display: inline" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_thumb_3.png" width="724" height="564" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
On this tab you can see all the server configuration values which are needed for your
client machine to connect to the server. Typically you don’t have to worry about the
details of these values. Next you’ll go to the Settings tab.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_10.png"&gt;&lt;img style="background-image: none; display: inline" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_thumb_4.png" width="724" height="564" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
On the Settings tab you can set the build configuration which should be used for the
publish process, the default value here is Release. There is also a checkbox to enable
you to delete any files on the server which do not exist in the project.
&lt;/p&gt;
&lt;p&gt;
Below that checkbox you will see a section for databases. The sample project shown
has an &lt;a href="http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application"&gt;Entity
Framework&lt;/a&gt; Code First model, named ContactsContext, and it uses &lt;a href="http://msdn.microsoft.com/en-us/library/hh770484"&gt;Code
First Migrations&lt;/a&gt; to manage the database schema. If you have any non-EF Code First
connection strings in web.config then those databases will show up as well but the
support for incrementally publishing the schema for those has not yet been finalized.
We are currently working on that. You can visit &lt;a href="http://sedodream.com/2012/06/07/VSPublishDialogUpdateDatabaseDialogDisabled.aspx"&gt;my
previous blog entry&lt;/a&gt; for more info on that.
&lt;/p&gt;
&lt;p&gt;
If you imported a .publishSettings file with a connection string then that connection
string would automatically be inserted in the textbox/dropdown for the connection
string. If you did not then you can use the … button to create a connection string
with the Connection String Builder dialog or you can simply type/paste in a connection
string. For the EF Code First contexts you will see the &lt;em&gt;Execute Code Frist Migrations&lt;/em&gt; checkbox.
When you check this when your site is published the web.config will be transformed
to enable the Code First migrations to be executed the first time that the context
is accessed. Now you can move to the Preview tab.
&lt;/p&gt;
&lt;p&gt;
When you first come to the Preview tab you will see a Start Preview button. Once you
click this button you will see the file operations which would be performed once you
publish. Since this site has never been published all the file operations are Add,
as you can see in the image below. The other Action values include; Update and Delete.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_14.png"&gt;&lt;img style="background-image: none; display: inline" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_thumb_6.png" width="724" height="564" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Once you are ready to publish you can click the Publish button. You can monitor the
progress of the publish process using the Output Window. If your publish profile had
a value for the Destination URL then the site will automatically be opened in the
default browser after the publish has successfully completed.
&lt;/p&gt;
&lt;h1&gt;Publish Profiles
&lt;/h1&gt;
&lt;p&gt;
One of the other changes in the publish experience is that publish profiles are now
stored as a part of your project. They are stored under the folder Properties\PublishProfiles
(&lt;em&gt;for VB projects its My Project\PublishProfiles&lt;/em&gt;) and the extension is .pubxml.
You can see this in the image below.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_18.png"&gt;&lt;img style="background-image: none; display: inline" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/da1ea8decc68_BC52/image_thumb_8.png" width="330" height="475" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
These .pubxml files are MSBuild files and you can modify these files in order to customize
the publish process. If you do not want the publish profile to be checked into version
control you can simply exclude it from the project. The publish dialog will look at
the files in the PublishProfiles folder so you will still be able to publish using
that profile. You can also leverage these publish profiles to simply publishing from
the command line. For example you can use the following syntax to publish from the
command line.
&lt;/p&gt;
&lt;p&gt;
msbuild.exe WebApplication2.csproj /p:DeployOnBuild=true;PublishProfile=&amp;quot;pubdemo
- Web Deploy&amp;quot;;Password={INSERT-PASSWORD}
&lt;/p&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;h1&gt;Resources
&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://go.microsoft.com/fwlink/?LinkID=254269&amp;amp;clcid=0x409"&gt;Windows Azure
SDK for Visual Studio 2010&lt;/a&gt; (&lt;em&gt;this contains the new Web Publish experience&lt;/em&gt;) 
&lt;/li&gt;
&lt;li&gt;
Tutorial: &lt;a href="https://www.windowsazure.com/en-us/develop/net/tutorials/web-site-with-sql-database/"&gt;Deploying
an ASP.NET Web Application to a Windows Azure Web Site and SQL Database&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://blogs.msdn.com/b/aspnetue/archive/2012/06/12/visual-studio-2012-rc-deployment-documentation-published.aspx"&gt;Visual
Studio 2012 RC Deployment Documentation Published&lt;/a&gt; (&lt;em&gt;the publish experience
in VS2012 RC is nearly identical to the VS 2010 Web Publish updates&lt;/em&gt;) 
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://sedodream.com/"&gt;Sayed’s blog&lt;/a&gt; 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
If you have any questions please feel free to directly reach out to me at sayedha(at){MicrosoftDOTCom}.
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi &lt;a href="https://twitter.com/#!/sayedihashimi"&gt;@SayedIHashimi&lt;/a&gt;
&lt;/p&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,bfa8b339-0bf2-4d9c-995b-beaef0ce39ba.aspx</comments>
      <category>asp.net</category>
      <category>Microsoft</category>
      <category>MSDeploy</category>
      <category>Visual Studio 2010</category>
      <category>web</category>
      <category>Web Deployment Tool</category>
      <category>Web Publishing Pipeline</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=c74e3388-0bdd-4295-85cb-b9ef0286947a</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,c74e3388-0bdd-4295-85cb-b9ef0286947a.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,c74e3388-0bdd-4295-85cb-b9ef0286947a.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=c74e3388-0bdd-4295-85cb-b9ef0286947a</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Today I just saw a question posted on stackoverflow.com asking <a href="http://stackoverflow.com/q/4151325/105999" target="_blank">Why
are some Web.config transforms tokenised into SetParameters.xml and others are not</a>?
Let me give some background on this topic for those who are not aware of what the
question is.
</p>
        <p>
With Visual Studio 2010 when you package your application using the Build Deployment
Package context menu option, see image below.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/e49083eab7c6_12533/image_2.png">
            <img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/e49083eab7c6_12533/image_thumb.png" width="352" height="484" />
          </a>
        </p>
        <p>
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 <strong>obj\Debug\Package\MvcApplication1.zip</strong>.
If you take this package and then import into IIS 7 with the “Import Application”
option shown below. Note: The machine must have the <a href="http://www.iis.net/download/WebDeploy" target="_blank">Web
Deployment Tool</a> (aka MSDeploy) installed.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/e49083eab7c6_12533/image_4.png">
            <img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/e49083eab7c6_12533/image_thumb_1.png" width="218" height="280" />
          </a>
        </p>
        <p>
Once you click on Import Application then browse out to the package you will be shown
a screen which prompts your for parameters. Its shown below.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/e49083eab7c6_12533/SNAGHTML2d2664.png">
            <img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SNAGHTML2d2664" border="0" alt="SNAGHTML2d2664" src="http://sedodream.com/content/binary/Windows-Live-Writer/e49083eab7c6_12533/SNAGHTML2d2664_thumb.png" width="681" height="514" />
          </a>
        </p>
        <p>
On this screen you can see that we are prompting for a couple parameter values here.
One is an IIS setting, Application Path, and the other is a connection string which
will be placed inside the web.config file. If your Web Application Project (WAP) 
had 5 different connection strings then they would automatically show up here on this
page. Since connection strings are replaced so often we create parameters for all
connection strings by default. You can define new parameters on your own, quite easily
actually, but that is the topic for another blog post.
</p>
        <p>
Now back to the question. He is asking why do we “tokenize” the connection strings
in web.config. To clarify take a look at my web.config file below.
</p>
        <pre class="brush: xml;">&lt;configuration&gt;
  &lt;appSettings&gt;
    &lt;add key="setting01" value="value01"/&gt;
  &lt;/appSettings&gt;
  
  &lt;connectionStrings&gt;
    &lt;add name="ApplicationServices"
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" /&gt;
  &lt;/connectionStrings&gt;
  
&lt;/configuration&gt;</pre>
        <p>
After I perform a package this will get changed. Take a look @ the web.config file
which resides in the package (you can get to the file at obj\{CofigurationName}\Package\PackageTmp\web.config).
You will see what is shown below.
</p>
        <pre class="brush: xml;">&lt;configuration&gt;
  &lt;appSettings&gt;
    &lt;add key="setting01" value="value01"/&gt;
  &lt;/appSettings&gt;
  &lt;connectionStrings&gt;
    &lt;add name="ApplicationServices"
         connectionString="$(ReplacableToken_ApplicationServices-Web.config Connection String_0)"
         providerName="System.Data.SqlClient" /&gt;
  &lt;/connectionStrings&gt;

&lt;/configuration&gt;</pre>
        <p>
So his question is why is the connection string replaced with $(ReplacableToken_ApplicationServices-Web.config
Connection String_0) and nothing else is? We do this because we do not want you to
accidently copy your web to a location and have it executing SQL statements against
a SQL server which you did not intend. The idea is that you will create a package
that you can deploy to many different environments. So the value that was in your
web.config (or web.debug.config/web.release.config if you are using a <a href="http://blogs.msdn.com/b/webdevtools/archive/2009/05/04/web-deployment-web-config-transformation.aspx?wa=wsignin1.0" target="_blank">web.config
transformation</a>) will not be placed inside the web.config in the package. Instead
those values will be used as defaults in the package itself. We also create a SetParameters.xml
file for you so that you can tweak the values. For my app see the MvcApplication1.SetParameters.xml
file below.
</p>
        <pre class="brush: xml;">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;parameters&gt;
  &lt;setParameter name="IIS Web Application Name" 
                value="Default Web Site/MvcApplication1_deploy" /&gt;
  &lt;setParameter name="ApplicationServices-Web.config Connection String" 
                value="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" /&gt;
&lt;/parameters&gt;</pre>
        <p>
The idea is that you can deploy your package in 2 ways. Through the IIS Manager which
will prompt you for the parameters or you can deploy using msdeploy.exe with the –setParamFile
switch to specify the path to the SetParameters.xml file. In this case I could create
a QA01.SetParameters.xml file along with a QA02.SetParameters.xml file to deploy my
web to my two QA servers. How do we do this?
</p>
        <h4>How connection strings are tokenized
</h4>
        <p>
You might be wondering how the connection strings are tokenized to begin with. With
Visual Studio 2010 we released web.config transformations, which all you to write
terse web.config transformations inside of files like web.debug.config/web.release.config.
When you package/publish your web these transform files are used to transform your
web.config based on what you expressed in the appropriate transform file. We have
an MSBuild task TransformXml which performs the transformation. We use that same task
to tokenize the connection strings. If you are interested in the details take a look
at %ProgramFiles32%\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets
in the <strong>AutoParameterizationWebConfigConnectionStringsCore</strong> target.
</p>
        <p>
Now what if you do not want the connection string tokenized?
</p>
        <h4>Prevent tokenizing connection strings
</h4>
        <p>
If you want to prevent your web.config connection strings from being tokenized it’s
pretty easy. All we need to do is the add a property to the build/package/publish
process. We can do that in 2 ways. Edit the project file itself or create a file with
the name {ProjectName}.wpp.targets where {ProjectName} is the name of your project.
The second approach is easier so I use that. In my case it would be MvcApplication1.wpp.targets.
The contents of the file are shown below.
</p>
        <pre class="brush: xml;">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;

  &lt;PropertyGroup&gt;
    &lt;AutoParameterizationWebConfigConnectionStrings&gt;false&lt;/AutoParameterizationWebConfigConnectionStrings&gt;
  &lt;/PropertyGroup&gt;
  
&lt;/Project&gt;

<strong><u>Note:
You may need to reload the project in Visual Studio for this to take effect.</u></strong></pre>
        <p>
Inside of this file I have declared the property, AutoParameterizationWebConfigConnectionStrings,
to be false. This is telling the Web Publishing Pipeline (WPP) that it should not
replace replace the connection strings with tokens, instead leave them as they are.
</p>
        <p>
Questions/Comments???
</p>
        <h4>Other Resources
</h4>
        <ul>
          <li>
            <a href="http://sedodream.com/2010/04/26/ConfigTransformationsOutsideOfWebAppBuilds.aspx">Config
transformations outside of web app builds</a>
          </li>
          <li>
            <a href="http://sedodream.com/2010/09/09/ExtendingXMLWebconfigConfigTransformation.aspx">Extending
XML (web.config) Config transformation</a>
          </li>
        </ul>
      </body>
      <title>ASP.NET Web Application: Publish/Package Tokenizing Parameters</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,c74e3388-0bdd-4295-85cb-b9ef0286947a.aspx</guid>
      <link>http://sedodream.com/2010/11/11/ASPNETWebApplicationPublishPackageTokenizingParameters.aspx</link>
      <pubDate>Thu, 11 Nov 2010 05:41:09 GMT</pubDate>
      <description>&lt;p&gt;
Today I just saw a question posted on stackoverflow.com asking &lt;a href="http://stackoverflow.com/q/4151325/105999" target="_blank"&gt;Why
are some Web.config transforms tokenised into SetParameters.xml and others are not&lt;/a&gt;?
Let me give some background on this topic for those who are not aware of what the
question is.
&lt;/p&gt;
&lt;p&gt;
With Visual Studio 2010 when you package your application using the Build Deployment
Package context menu option, see image below.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/e49083eab7c6_12533/image_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/e49083eab7c6_12533/image_thumb.png" width="352" height="484" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
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 &lt;strong&gt;obj\Debug\Package\MvcApplication1.zip&lt;/strong&gt;.
If you take this package and then import into IIS 7 with the “Import Application”
option shown below. Note: The machine must have the &lt;a href="http://www.iis.net/download/WebDeploy" target="_blank"&gt;Web
Deployment Tool&lt;/a&gt; (aka MSDeploy) installed.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/e49083eab7c6_12533/image_4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/e49083eab7c6_12533/image_thumb_1.png" width="218" height="280" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Once you click on Import Application then browse out to the package you will be shown
a screen which prompts your for parameters. Its shown below.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/e49083eab7c6_12533/SNAGHTML2d2664.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SNAGHTML2d2664" border="0" alt="SNAGHTML2d2664" src="http://sedodream.com/content/binary/Windows-Live-Writer/e49083eab7c6_12533/SNAGHTML2d2664_thumb.png" width="681" height="514" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
On this screen you can see that we are prompting for a couple parameter values here.
One is an IIS setting, Application Path, and the other is a connection string which
will be placed inside the web.config file. If your Web Application Project (WAP)&amp;#160;
had 5 different connection strings then they would automatically show up here on this
page. Since connection strings are replaced so often we create parameters for all
connection strings by default. You can define new parameters on your own, quite easily
actually, but that is the topic for another blog post.
&lt;/p&gt;
&lt;p&gt;
Now back to the question. He is asking why do we “tokenize” the connection strings
in web.config. To clarify take a look at my web.config file below.
&lt;/p&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;configuration&amp;gt;
  &amp;lt;appSettings&amp;gt;
    &amp;lt;add key=&amp;quot;setting01&amp;quot; value=&amp;quot;value01&amp;quot;/&amp;gt;
  &amp;lt;/appSettings&amp;gt;
  
  &amp;lt;connectionStrings&amp;gt;
    &amp;lt;add name=&amp;quot;ApplicationServices&amp;quot;
         connectionString=&amp;quot;data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true&amp;quot;
         providerName=&amp;quot;System.Data.SqlClient&amp;quot; /&amp;gt;
  &amp;lt;/connectionStrings&amp;gt;
  
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;
&lt;p&gt;
After I perform a package this will get changed. Take a look @ the web.config file
which resides in the package (you can get to the file at obj\{CofigurationName}\Package\PackageTmp\web.config).
You will see what is shown below.
&lt;/p&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;configuration&amp;gt;
  &amp;lt;appSettings&amp;gt;
    &amp;lt;add key=&amp;quot;setting01&amp;quot; value=&amp;quot;value01&amp;quot;/&amp;gt;
  &amp;lt;/appSettings&amp;gt;
  &amp;lt;connectionStrings&amp;gt;
    &amp;lt;add name=&amp;quot;ApplicationServices&amp;quot;
         connectionString=&amp;quot;$(ReplacableToken_ApplicationServices-Web.config Connection String_0)&amp;quot;
         providerName=&amp;quot;System.Data.SqlClient&amp;quot; /&amp;gt;
  &amp;lt;/connectionStrings&amp;gt;

&amp;lt;/configuration&amp;gt;&lt;/pre&gt;
&lt;p&gt;
So his question is why is the connection string replaced with $(ReplacableToken_ApplicationServices-Web.config
Connection String_0) and nothing else is? We do this because we do not want you to
accidently copy your web to a location and have it executing SQL statements against
a SQL server which you did not intend. The idea is that you will create a package
that you can deploy to many different environments. So the value that was in your
web.config (or web.debug.config/web.release.config if you are using a &lt;a href="http://blogs.msdn.com/b/webdevtools/archive/2009/05/04/web-deployment-web-config-transformation.aspx?wa=wsignin1.0" target="_blank"&gt;web.config
transformation&lt;/a&gt;) will not be placed inside the web.config in the package. Instead
those values will be used as defaults in the package itself. We also create a SetParameters.xml
file for you so that you can tweak the values. For my app see the MvcApplication1.SetParameters.xml
file below.
&lt;/p&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;
&amp;lt;parameters&amp;gt;
  &amp;lt;setParameter name=&amp;quot;IIS Web Application Name&amp;quot; 
                value=&amp;quot;Default Web Site/MvcApplication1_deploy&amp;quot; /&amp;gt;
  &amp;lt;setParameter name=&amp;quot;ApplicationServices-Web.config Connection String&amp;quot; 
                value=&amp;quot;data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true&amp;quot; /&amp;gt;
&amp;lt;/parameters&amp;gt;&lt;/pre&gt;
&lt;p&gt;
The idea is that you can deploy your package in 2 ways. Through the IIS Manager which
will prompt you for the parameters or you can deploy using msdeploy.exe with the –setParamFile
switch to specify the path to the SetParameters.xml file. In this case I could create
a QA01.SetParameters.xml file along with a QA02.SetParameters.xml file to deploy my
web to my two QA servers. How do we do this?
&lt;/p&gt;
&lt;h4&gt;How connection strings are tokenized
&lt;/h4&gt;
&lt;p&gt;
You might be wondering how the connection strings are tokenized to begin with. With
Visual Studio 2010 we released web.config transformations, which all you to write
terse web.config transformations inside of files like web.debug.config/web.release.config.
When you package/publish your web these transform files are used to transform your
web.config based on what you expressed in the appropriate transform file. We have
an MSBuild task TransformXml which performs the transformation. We use that same task
to tokenize the connection strings. If you are interested in the details take a look
at %ProgramFiles32%\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets
in the &lt;strong&gt;AutoParameterizationWebConfigConnectionStringsCore&lt;/strong&gt; target.
&lt;/p&gt;
&lt;p&gt;
Now what if you do not want the connection string tokenized?
&lt;/p&gt;
&lt;h4&gt;Prevent tokenizing connection strings
&lt;/h4&gt;
&lt;p&gt;
If you want to prevent your web.config connection strings from being tokenized it’s
pretty easy. All we need to do is the add a property to the build/package/publish
process. We can do that in 2 ways. Edit the project file itself or create a file with
the name {ProjectName}.wpp.targets where {ProjectName} is the name of your project.
The second approach is easier so I use that. In my case it would be MvcApplication1.wpp.targets.
The contents of the file are shown below.
&lt;/p&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;
&amp;lt;Project xmlns=&amp;quot;http://schemas.microsoft.com/developer/msbuild/2003&amp;quot;&amp;gt;

  &amp;lt;PropertyGroup&amp;gt;
    &amp;lt;AutoParameterizationWebConfigConnectionStrings&amp;gt;false&amp;lt;/AutoParameterizationWebConfigConnectionStrings&amp;gt;
  &amp;lt;/PropertyGroup&amp;gt;
  
&amp;lt;/Project&amp;gt;

&lt;strong&gt;&lt;u&gt;Note:
You may need to reload the project in Visual Studio for this to take effect.&lt;/u&gt;&lt;/strong&gt;&lt;/pre&gt;
&lt;p&gt;
Inside of this file I have declared the property, AutoParameterizationWebConfigConnectionStrings,
to be false. This is telling the Web Publishing Pipeline (WPP) that it should not
replace replace the connection strings with tokens, instead leave them as they are.
&lt;/p&gt;
&lt;p&gt;
Questions/Comments???
&lt;/p&gt;
&lt;h4&gt;Other Resources
&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://sedodream.com/2010/04/26/ConfigTransformationsOutsideOfWebAppBuilds.aspx"&gt;Config
transformations outside of web app builds&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://sedodream.com/2010/09/09/ExtendingXMLWebconfigConfigTransformation.aspx"&gt;Extending
XML (web.config) Config transformation&lt;/a&gt; 
&lt;/li&gt;
&lt;/ul&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,c74e3388-0bdd-4295-85cb-b9ef0286947a.aspx</comments>
      <category>asp.net</category>
      <category>Deployment</category>
      <category>MSBuild</category>
      <category>MSBuild 4.0</category>
      <category>MSDeploy</category>
    </item>
  </channel>
</rss>