<?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, C#, Visual Studio, Training, and more</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, 14 May 2012 03:14:13 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=f6513821-efe2-4c6a-928a-43ce9cc77b36</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,f6513821-efe2-4c6a-928a-43ce9cc77b36.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,f6513821-efe2-4c6a-928a-43ce9cc77b36.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=f6513821-efe2-4c6a-928a-43ce9cc77b36</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I was on StackOverflow today and noticed a <a href="http://stackoverflow.com/q/10555649/105999" target="_blank">question</a> along
these lines “<a href="http://stackoverflow.com/q/10555649/105999" target="_blank">How
to I create a target which is executed when CoreCompile is, and that is skipped when
CoreCompile is skipped</a>?” Below is my answer.
</p>
        <p>
This is a tricky problem to solve for the general case, but it is pretty easy in your
case because CoreCompile has special built in support for this scenario. Before I
go into the details of how you can accomplish this with CoreCompile let me explain
how it works in general.
</p>
        <h3>Explanation of the general case
</h3>
        <p>
In MSBuild targets are skipped due to Incremental Building. Incremental Build is driven
purely off of the Inputs and Outputs attributes on the Target itself. The inputs are
a list of files that the target will "use" and the outputs are a list of
files that are "generated" by the target. I'm using quotes because its a
loose concept not a concrete one. To simplify it you can just treat inputs/outputs
as lists of files. When the target is about to be executed MSBuild will take the inputs
and compare the timestamps of them to the outputs. If all the outputs are newer then
the inputs then the target will be skipped. (FYI If you want to know what happens
when only some outputs are out-of-date read my blog at<a href="http://sedodream.com/2010/09/23/MSBuildYouveHeardOfIncrementalBuildingButHaveYouHeardOfPartialBuilding.aspx">http://sedodream.com/2010/09/23/MSBuildYouveHeardOfIncrementalBuildingButHaveYouHeardOfPartialBuilding.aspx</a>).
</p>
        <p>
In any case if you want a target to be skipped you have to craft your Inputs/Outputs
correctly. In your case you want to skip your target whenever the CoreCompile is skipped,
so at the surface it would seem that you could simply copy the Inputs/Outputs of CoreCompile
but that doesn't work. It doesn't work because when CoreCompile is executed the files
may be out-of-date but that target itself brings them up-to-date. Then when you target
is executed since they are all up-to-date it will be skipped. You would have to copy
the Inputs/Outputs and append an additional file to inputs/outputs which you target
creates. This would ensure that your target wouldn't get skipped during that first
pass.
</p>
        <h3>Specific solution for CoreCompile
</h3>
        <p>
If you take a look at the project file you will see towards the bottom that the file
Microsoft.Common.targets is Imported, this file will then import the language specific
.targets file. For example it will Import either Microsoft.CSharp.targets or Microsoft.VisualBasic.targets
(if you are using C# or VB). In those .targets files you will find CoreCompile defined.
In the definition for CoreCompile you will find the following at the end.
</p>
        <pre class="brush: xml;">&lt;CallTarget Targets="$(TargetsTriggeredByCompilation)" Condition="'$(TargetsTriggeredByCompilation)' != ''"/&gt;</pre>
        <p>
This will call all the targets defined in the <code>TargetsTriggeredByCompilation</code> property.
So if you want your target to be called whenever CoreCompile is <strong>executed</strong> you
can extend that property. Here is how to do that.
</p>
        <pre class="brush: xml;">&lt;PropertyGroup&gt;
  &lt;TargetsTriggeredByCompilation&gt;
    $(TargetsTriggeredByCompilation);
    MyCustomTarget
  &lt;/TargetsTriggeredByCompilation&gt;
&lt;/PropertyGroup&gt;

&lt;Target Name="MyCustomTarget"&gt;
  &lt;Message Text="MyCustomTarget called" Importance ="high"/&gt;
&lt;/Target&gt;</pre>
        <p>
In this case I define the property <strong>TargetsTriggeredByCompilation</strong> and
I append MyCustomTarget to it. It's very important that you include the <strong>$(TargetsTriggeredByCompilation);</strong> there,
if you don't then you won't be appending but overwriting. So if anyone else used this
technique you'd wipe out their target.
</p>
        <p>
Below is an image showing where I build once and CoreCompile and MyCustomTarget are
executed. Then the second build CoreCompile is skipped any MyCustomTarget is never
called.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/MSBuild-how-to-execute-a-target-after-Co_11A58/build-output_2.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="build-output" border="0" alt="build-output" src="http://sedodream.com/content/binary/Windows-Live-Writer/MSBuild-how-to-execute-a-target-after-Co_11A58/build-output_thumb.png" width="1189" height="621" />
          </a>
        </p>
        <p>
 
</p>
        <p>
Sayed Ibrahim Hashimi <a href="http://twitter.com/sayedihashimi" target="_blank">@SayedIHashimi</a></p>
        <img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=f6513821-efe2-4c6a-928a-43ce9cc77b36" />
      </body>
      <title>MSBuild how to execute a target after CoreCompile</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,f6513821-efe2-4c6a-928a-43ce9cc77b36.aspx</guid>
      <link>http://sedodream.com/2012/05/14/MSBuildHowToExecuteATargetAfterCoreCompile.aspx</link>
      <pubDate>Mon, 14 May 2012 03:14:13 GMT</pubDate>
      <description>&lt;p&gt;
I was on StackOverflow today and noticed a &lt;a href="http://stackoverflow.com/q/10555649/105999" target="_blank"&gt;question&lt;/a&gt; along
these lines “&lt;a href="http://stackoverflow.com/q/10555649/105999" target="_blank"&gt;How
to I create a target which is executed when CoreCompile is, and that is skipped when
CoreCompile is skipped&lt;/a&gt;?” Below is my answer.
&lt;/p&gt;
&lt;p&gt;
This is a tricky problem to solve for the general case, but it is pretty easy in your
case because CoreCompile has special built in support for this scenario. Before I
go into the details of how you can accomplish this with CoreCompile let me explain
how it works in general.
&lt;/p&gt;
&lt;h3&gt;Explanation of the general case
&lt;/h3&gt;
&lt;p&gt;
In MSBuild targets are skipped due to Incremental Building. Incremental Build is driven
purely off of the Inputs and Outputs attributes on the Target itself. The inputs are
a list of files that the target will &amp;quot;use&amp;quot; and the outputs are a list of
files that are &amp;quot;generated&amp;quot; by the target. I'm using quotes because its a
loose concept not a concrete one. To simplify it you can just treat inputs/outputs
as lists of files. When the target is about to be executed MSBuild will take the inputs
and compare the timestamps of them to the outputs. If all the outputs are newer then
the inputs then the target will be skipped. (FYI If you want to know what happens
when only some outputs are out-of-date read my blog at&lt;a href="http://sedodream.com/2010/09/23/MSBuildYouveHeardOfIncrementalBuildingButHaveYouHeardOfPartialBuilding.aspx"&gt;http://sedodream.com/2010/09/23/MSBuildYouveHeardOfIncrementalBuildingButHaveYouHeardOfPartialBuilding.aspx&lt;/a&gt;).
&lt;/p&gt;
&lt;p&gt;
In any case if you want a target to be skipped you have to craft your Inputs/Outputs
correctly. In your case you want to skip your target whenever the CoreCompile is skipped,
so at the surface it would seem that you could simply copy the Inputs/Outputs of CoreCompile
but that doesn't work. It doesn't work because when CoreCompile is executed the files
may be out-of-date but that target itself brings them up-to-date. Then when you target
is executed since they are all up-to-date it will be skipped. You would have to copy
the Inputs/Outputs and append an additional file to inputs/outputs which you target
creates. This would ensure that your target wouldn't get skipped during that first
pass.
&lt;/p&gt;
&lt;h3&gt;Specific solution for CoreCompile
&lt;/h3&gt;
&lt;p&gt;
If you take a look at the project file you will see towards the bottom that the file
Microsoft.Common.targets is Imported, this file will then import the language specific
.targets file. For example it will Import either Microsoft.CSharp.targets or Microsoft.VisualBasic.targets
(if you are using C# or VB). In those .targets files you will find CoreCompile defined.
In the definition for CoreCompile you will find the following at the end.
&lt;/p&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;CallTarget Targets=&amp;quot;$(TargetsTriggeredByCompilation)&amp;quot; Condition=&amp;quot;'$(TargetsTriggeredByCompilation)' != ''&amp;quot;/&amp;gt;&lt;/pre&gt;
&lt;p&gt;
This will call all the targets defined in the &lt;code&gt;TargetsTriggeredByCompilation&lt;/code&gt; property.
So if you want your target to be called whenever CoreCompile is &lt;strong&gt;executed&lt;/strong&gt; you
can extend that property. Here is how to do that.
&lt;/p&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;PropertyGroup&amp;gt;
  &amp;lt;TargetsTriggeredByCompilation&amp;gt;
    $(TargetsTriggeredByCompilation);
    MyCustomTarget
  &amp;lt;/TargetsTriggeredByCompilation&amp;gt;
&amp;lt;/PropertyGroup&amp;gt;

&amp;lt;Target Name=&amp;quot;MyCustomTarget&amp;quot;&amp;gt;
  &amp;lt;Message Text=&amp;quot;MyCustomTarget called&amp;quot; Importance =&amp;quot;high&amp;quot;/&amp;gt;
&amp;lt;/Target&amp;gt;&lt;/pre&gt;
&lt;p&gt;
In this case I define the property &lt;strong&gt;TargetsTriggeredByCompilation&lt;/strong&gt; and
I append MyCustomTarget to it. It's very important that you include the &lt;strong&gt;$(TargetsTriggeredByCompilation);&lt;/strong&gt; there,
if you don't then you won't be appending but overwriting. So if anyone else used this
technique you'd wipe out their target.
&lt;/p&gt;
&lt;p&gt;
Below is an image showing where I build once and CoreCompile and MyCustomTarget are
executed. Then the second build CoreCompile is skipped any MyCustomTarget is never
called.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/MSBuild-how-to-execute-a-target-after-Co_11A58/build-output_2.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="build-output" border="0" alt="build-output" src="http://sedodream.com/content/binary/Windows-Live-Writer/MSBuild-how-to-execute-a-target-after-Co_11A58/build-output_thumb.png" width="1189" height="621" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi &lt;a href="http://twitter.com/sayedihashimi" target="_blank"&gt;@SayedIHashimi&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=f6513821-efe2-4c6a-928a-43ce9cc77b36" /&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,f6513821-efe2-4c6a-928a-43ce9cc77b36.aspx</comments>
      <category>MSBuild</category>
      <category>Visual Studio</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=604eadfe-46bf-4989-bac8-814e2701e52a</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,604eadfe-46bf-4989-bac8-814e2701e52a.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,604eadfe-46bf-4989-bac8-814e2701e52a.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=604eadfe-46bf-4989-bac8-814e2701e52a</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
If you have used the Visual Studio web publish in either VS 2010 or VS 11 to create
Web Deploy packages then you probably know that we parameterize connection strings
in web.config automatically. In case you are not familiar with Web Deploy parameters,
they are a way to declare that you want to easily be able to update a value of something
when publishing the package later on. Connection strings are good examples of something
which typically needs to be updated during publish.
</p>
        <p>
As I previously stated if you create a Web Deploy package in Visual Studio we will
automatically create Web Deploy parameters for all your connection strings in web.config.
Earlier today I saw a <a href="http://stackoverflow.com/questions/10411326/how-to-convert-configsource-to-inline-elements-in-web-config-on-transformation">question
on StackOverflow asking how to parameterize connection strings in non-web.config</a> files
(<em>question actually asked something else, but I think this is what he’s really
wanting</em>). I created a sample showing how to do this. Below is what the connectionStrings
element looks like in web.config.
</p>
        <pre class="brush: xml;">&lt;connectionStrings configSource="connectionStrings.config" /&gt;</pre>
        <p>
And here is connectionStrings.config
</p>
        <pre class="brush: xml;">&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;connectionStrings&gt;
  &lt;clear/&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;add name="OtherConnectionString"
       connectionString="data source=.\SQLExpress;Integrated Security=SSPI;Initial Catalog=foo"
       providerName="System.Data.SqlClient"/&gt;
&lt;/connectionStrings&gt;</pre>
        <p>
In order to parameterize these connection strings you will have to extend the Web
Publish Pipeline. To do that create a file named <strong>{project-name}.wpp.targets</strong> in
the root of the project in which you are working (for VS 11 projects you can place
all this directly inside of the .pubxml files). This will be an MSBuild file which
will get imported into the build/publish process. Below is the file which needs to
be created.
</p>
        <pre class="brush: xml;">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;

  &lt;ItemGroup&gt;
    &lt;!-- Here we need to declare MSDeploy parameters for connection strings in connectionStrings.config --&gt;
    &lt;MsDeployDeclareParameters Include="ApplicationServices-ConnectionString" &gt;
      &lt;Kind&gt;XmlFile&lt;/Kind&gt;
      &lt;Scope&gt;connectionStrings.config$&lt;/Scope&gt;
      &lt;Match&gt;/connectionStrings/add[@name='ApplicationServices']/@connectionString&lt;/Match&gt;
      &lt;Description&gt;Connection string for ApplicationServices&lt;/Description&gt;
      &lt;DefaultValue&gt;data source=(localhost);Initial Catalog=AppServices&lt;/DefaultValue&gt;
      &lt;Tags&gt;SqlConnectionString&lt;/Tags&gt;
    &lt;/MsDeployDeclareParameters&gt;

    &lt;MsDeployDeclareParameters Include="OtherConnectionString-ConnectionString" &gt;
      &lt;Kind&gt;XmlFile&lt;/Kind&gt;
      &lt;Scope&gt;connectionStrings.config$&lt;/Scope&gt;
      &lt;Match&gt;/connectionStrings/add[@name='OtherConnectionString']/@connectionString&lt;/Match&gt;
      &lt;Description&gt;Connection string for OtherConnectionString&lt;/Description&gt;
      &lt;DefaultValue&gt;data source=(localhost);Initial Catalog=OtherDb&lt;/DefaultValue&gt;
      &lt;Tags&gt;SqlConnectionString&lt;/Tags&gt;
    &lt;/MsDeployDeclareParameters&gt;
  &lt;/ItemGroup&gt;

&lt;/Project&gt;</pre>
        <p>
Here you can see that I am creating values for MSDeployDeclareParameters. When you
package/publish this item list is used to create the MSDeploy parameters. Below is
an explanation of the metadata values each contain.
</p>
        <ul>
          <li>
Kind = for this case it will always be Xmlfile, <a href="http://technet.microsoft.com/en-us/library/dd569084(v=WS.10).aspx">learn
more</a></li>
          <li>
Scope = a regular expression to the file which needs to be modified</li>
          <li>
Match = an XPath expression to the attribute/element to be updated</li>
          <li>
Description = optional description (this will show up in the IIS manager if the pkg
is imported)</li>
          <li>
DefaultValue = optional default value for the for the parameter</li>
          <li>
Tags = optional, for connection strings use SqlConnectionString</li>
        </ul>
        <p>
After you create this file you will need to close/re-open VS (it caches imported .targets
files). Then you can create a web deploy package. When you do so these new parameters
will be declared. In my case I then imported this in the IIS manager and here is the
dialog which shows up for the parameters.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/VS-Web-Publish-How-to-parameteriz.config_C47E/SNAGHTML94cce08.png">
            <img title="SNAGHTML94cce08" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="SNAGHTML94cce08" src="http://sedodream.com/content/binary/Windows-Live-Writer/VS-Web-Publish-How-to-parameteriz.config_C47E/SNAGHTML94cce08_thumb.png" width="691" height="525" />
          </a>
        </p>
        <p>
As you can see the Application Path parameter is shown there as well as my custom
connection string values. When I update the values in the text box and opened connectionStrings.config
on my web server they were the values I entered in the dialog box.
</p>
        <p>
FYI I have uploaded this sample to my github account at <a href="https://github.com/sayedihashimi/sayed-samples/tree/master/ParameterizeConStringConfig">ParameterizeConStringConfig</a>.
</p>
        <p>
Sayed Ibrahim Hashimi <a href="http://twitter.com/sayedihashimi">@SayedIHashimi</a></p>
        <img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=604eadfe-46bf-4989-bac8-814e2701e52a" />
      </body>
      <title>VS Web Publish: How to parameterize connection strings outside of web.config</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,604eadfe-46bf-4989-bac8-814e2701e52a.aspx</guid>
      <link>http://sedodream.com/2012/05/13/VSWebPublishHowToParameterizeConnectionStringsOutsideOfWebconfig.aspx</link>
      <pubDate>Sun, 13 May 2012 21:18:03 GMT</pubDate>
      <description>&lt;p&gt;
If you have used the Visual Studio web publish in either VS 2010 or VS 11 to create
Web Deploy packages then you probably know that we parameterize connection strings
in web.config automatically. In case you are not familiar with Web Deploy parameters,
they are a way to declare that you want to easily be able to update a value of something
when publishing the package later on. Connection strings are good examples of something
which typically needs to be updated during publish.
&lt;/p&gt;
&lt;p&gt;
As I previously stated if you create a Web Deploy package in Visual Studio we will
automatically create Web Deploy parameters for all your connection strings in web.config.
Earlier today I saw a &lt;a href="http://stackoverflow.com/questions/10411326/how-to-convert-configsource-to-inline-elements-in-web-config-on-transformation"&gt;question
on StackOverflow asking how to parameterize connection strings in non-web.config&lt;/a&gt; files
(&lt;em&gt;question actually asked something else, but I think this is what he’s really
wanting&lt;/em&gt;). I created a sample showing how to do this. Below is what the connectionStrings
element looks like in web.config.
&lt;/p&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;connectionStrings configSource=&amp;quot;connectionStrings.config&amp;quot; /&amp;gt;&lt;/pre&gt;
&lt;p&gt;
And here is connectionStrings.config
&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;connectionStrings&amp;gt;
  &amp;lt;clear/&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;add name=&amp;quot;OtherConnectionString&amp;quot;
       connectionString=&amp;quot;data source=.\SQLExpress;Integrated Security=SSPI;Initial Catalog=foo&amp;quot;
       providerName=&amp;quot;System.Data.SqlClient&amp;quot;/&amp;gt;
&amp;lt;/connectionStrings&amp;gt;&lt;/pre&gt;
&lt;p&gt;
In order to parameterize these connection strings you will have to extend the Web
Publish Pipeline. To do that create a file named &lt;strong&gt;{project-name}.wpp.targets&lt;/strong&gt; in
the root of the project in which you are working (for VS 11 projects you can place
all this directly inside of the .pubxml files). This will be an MSBuild file which
will get imported into the build/publish process. Below is the file which needs to
be created.
&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 ToolsVersion=&amp;quot;4.0&amp;quot; xmlns=&amp;quot;http://schemas.microsoft.com/developer/msbuild/2003&amp;quot;&amp;gt;

  &amp;lt;ItemGroup&amp;gt;
    &amp;lt;!-- Here we need to declare MSDeploy parameters for connection strings in connectionStrings.config --&amp;gt;
    &amp;lt;MsDeployDeclareParameters Include=&amp;quot;ApplicationServices-ConnectionString&amp;quot; &amp;gt;
      &amp;lt;Kind&amp;gt;XmlFile&amp;lt;/Kind&amp;gt;
      &amp;lt;Scope&amp;gt;connectionStrings.config$&amp;lt;/Scope&amp;gt;
      &amp;lt;Match&amp;gt;/connectionStrings/add[@name='ApplicationServices']/@connectionString&amp;lt;/Match&amp;gt;
      &amp;lt;Description&amp;gt;Connection string for ApplicationServices&amp;lt;/Description&amp;gt;
      &amp;lt;DefaultValue&amp;gt;data source=(localhost);Initial Catalog=AppServices&amp;lt;/DefaultValue&amp;gt;
      &amp;lt;Tags&amp;gt;SqlConnectionString&amp;lt;/Tags&amp;gt;
    &amp;lt;/MsDeployDeclareParameters&amp;gt;

    &amp;lt;MsDeployDeclareParameters Include=&amp;quot;OtherConnectionString-ConnectionString&amp;quot; &amp;gt;
      &amp;lt;Kind&amp;gt;XmlFile&amp;lt;/Kind&amp;gt;
      &amp;lt;Scope&amp;gt;connectionStrings.config$&amp;lt;/Scope&amp;gt;
      &amp;lt;Match&amp;gt;/connectionStrings/add[@name='OtherConnectionString']/@connectionString&amp;lt;/Match&amp;gt;
      &amp;lt;Description&amp;gt;Connection string for OtherConnectionString&amp;lt;/Description&amp;gt;
      &amp;lt;DefaultValue&amp;gt;data source=(localhost);Initial Catalog=OtherDb&amp;lt;/DefaultValue&amp;gt;
      &amp;lt;Tags&amp;gt;SqlConnectionString&amp;lt;/Tags&amp;gt;
    &amp;lt;/MsDeployDeclareParameters&amp;gt;
  &amp;lt;/ItemGroup&amp;gt;

&amp;lt;/Project&amp;gt;&lt;/pre&gt;
&lt;p&gt;
Here you can see that I am creating values for MSDeployDeclareParameters. When you
package/publish this item list is used to create the MSDeploy parameters. Below is
an explanation of the metadata values each contain.
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Kind = for this case it will always be Xmlfile, &lt;a href="http://technet.microsoft.com/en-us/library/dd569084(v=WS.10).aspx"&gt;learn
more&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
Scope = a regular expression to the file which needs to be modified&lt;/li&gt;
&lt;li&gt;
Match = an XPath expression to the attribute/element to be updated&lt;/li&gt;
&lt;li&gt;
Description = optional description (this will show up in the IIS manager if the pkg
is imported)&lt;/li&gt;
&lt;li&gt;
DefaultValue = optional default value for the for the parameter&lt;/li&gt;
&lt;li&gt;
Tags = optional, for connection strings use SqlConnectionString&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
After you create this file you will need to close/re-open VS (it caches imported .targets
files). Then you can create a web deploy package. When you do so these new parameters
will be declared. In my case I then imported this in the IIS manager and here is the
dialog which shows up for the parameters.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/VS-Web-Publish-How-to-parameteriz.config_C47E/SNAGHTML94cce08.png"&gt;&lt;img title="SNAGHTML94cce08" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="SNAGHTML94cce08" src="http://sedodream.com/content/binary/Windows-Live-Writer/VS-Web-Publish-How-to-parameteriz.config_C47E/SNAGHTML94cce08_thumb.png" width="691" height="525" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
As you can see the Application Path parameter is shown there as well as my custom
connection string values. When I update the values in the text box and opened connectionStrings.config
on my web server they were the values I entered in the dialog box.
&lt;/p&gt;
&lt;p&gt;
FYI I have uploaded this sample to my github account at &lt;a href="https://github.com/sayedihashimi/sayed-samples/tree/master/ParameterizeConStringConfig"&gt;ParameterizeConStringConfig&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi &lt;a href="http://twitter.com/sayedihashimi"&gt;@SayedIHashimi&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=604eadfe-46bf-4989-bac8-814e2701e52a" /&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,604eadfe-46bf-4989-bac8-814e2701e52a.aspx</comments>
      <category>MSBuild</category>
      <category>MSBuild 4.0</category>
      <category>MSDeploy</category>
      <category>Visual Studio</category>
      <category>Web Deployment Tool</category>
      <category>Web Publishing Pipeline</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=639ccf51-43f4-4638-be23-1201c654171a</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,639ccf51-43f4-4638-be23-1201c654171a.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,639ccf51-43f4-4638-be23-1201c654171a.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=639ccf51-43f4-4638-be23-1201c654171a</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
\I receive a lot of questions regarding <a href="http://msdn.microsoft.com/en-us/library/dd465326.aspx">web.config
transforms</a>, which have existed in Visual Studio since 2010, and wanted to clear
up the support that we have in this area. These transforms show up in the solution
explorer underneath web.config as shown in the image below.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/web.config-transforms_10FB5/image_2.png">
            <img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/web.config-transforms_10FB5/image_thumb.png" width="291" height="329" />
          </a>
        </p>
        <p>
Since the names of these transforms include the build configuration many people expect
that web.config will be transformed when they start debugging (F5) or run the app
(CTRL+F5) in Visual Studio. But sadly this is not the case. <strong>These transforms
are kicked in only when the web is packaged or published</strong>. I totally agree
that this would be awesome, and I even blogged about how to enable it at <a href="http://sedodream.com/2010/10/21/ASPNETWebProjectsWebdebugconfigWebreleaseconfig.aspx">http://sedodream.com/2010/10/21/ASPNETWebProjectsWebdebugconfigWebreleaseconfig.aspx</a>.
It may seem like it would be really easy for us to include this support in the box,
but unfortunately that is not the case. The reason why we are not able to implement
this feature at this time is because a lot of our tooling (<em>and many partners</em>)
relies on web.config directly. For example when you drag and drop a database object
onto a web form, it will generate a connection string into the web.config. There are
a lot of features are like this. It is a significant investment for us to make a change
of this level. We were not able to get this done for Visual Studio 11, but it is on
our radar and we are looking to see what we can do in this area in the future.
</p>
        <p>
Sayed Ibrahim Hashimi <a href="https://twitter.com/#!/sayedihashimi">@SayedIHashimi</a></p>
        <img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=639ccf51-43f4-4638-be23-1201c654171a" />
      </body>
      <title>web.config transforms, they are invoked on package and publish not F5</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,639ccf51-43f4-4638-be23-1201c654171a.aspx</guid>
      <link>http://sedodream.com/2012/05/12/webconfigTransformsTheyAreInvokedOnPackageAndPublishNotF5.aspx</link>
      <pubDate>Sat, 12 May 2012 02:29:15 GMT</pubDate>
      <description>&lt;p&gt;
\I receive a lot of questions regarding &lt;a href="http://msdn.microsoft.com/en-us/library/dd465326.aspx"&gt;web.config
transforms&lt;/a&gt;, which have existed in Visual Studio since 2010, and wanted to clear
up the support that we have in this area. These transforms show up in the solution
explorer underneath web.config as shown in the image below.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/web.config-transforms_10FB5/image_2.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/web.config-transforms_10FB5/image_thumb.png" width="291" height="329" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Since the names of these transforms include the build configuration many people expect
that web.config will be transformed when they start debugging (F5) or run the app
(CTRL+F5) in Visual Studio. But sadly this is not the case. &lt;strong&gt;These transforms
are kicked in only when the web is packaged or published&lt;/strong&gt;. I totally agree
that this would be awesome, and I even blogged about how to enable it at &lt;a href="http://sedodream.com/2010/10/21/ASPNETWebProjectsWebdebugconfigWebreleaseconfig.aspx"&gt;http://sedodream.com/2010/10/21/ASPNETWebProjectsWebdebugconfigWebreleaseconfig.aspx&lt;/a&gt;.
It may seem like it would be really easy for us to include this support in the box,
but unfortunately that is not the case. The reason why we are not able to implement
this feature at this time is because a lot of our tooling (&lt;em&gt;and many partners&lt;/em&gt;)
relies on web.config directly. For example when you drag and drop a database object
onto a web form, it will generate a connection string into the web.config. There are
a lot of features are like this. It is a significant investment for us to make a change
of this level. We were not able to get this done for Visual Studio 11, but it is on
our radar and we are looking to see what we can do in this area in the future.
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi &lt;a href="https://twitter.com/#!/sayedihashimi"&gt;@SayedIHashimi&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=639ccf51-43f4-4638-be23-1201c654171a" /&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,639ccf51-43f4-4638-be23-1201c654171a.aspx</comments>
      <category>Visual Studio 2010</category>
      <category>web</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=fb09b691-0dce-4bf9-8db0-805e74bc0af2</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,fb09b691-0dce-4bf9-8db0-805e74bc0af2.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,fb09b691-0dce-4bf9-8db0-805e74bc0af2.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=fb09b691-0dce-4bf9-8db0-805e74bc0af2</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Have you ever tried to perform an operation on a file (i.e. delete) just to be faced
with an error relating to the fact that an application is locking the file? This happens
to me a lot, including just now. I was writing some code and tried to switch branches
and was given the error below.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/Windows-how-to-determine-what-is-locking_EB5D/image_4.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/Windows-how-to-determine-what-is-locking_EB5D/image_thumb_1.png" width="903" height="51" />
          </a>
        </p>
        <p>
So I closed down Visual Studio as well as IIS Express as I figured those were the
ones which had the lock on the file, and tried again (a few times actually <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://sedodream.com/content/binary/Windows-Live-Writer/Windows-how-to-determine-what-is-locking_EB5D/wlEmoticon-smile_2.png" /> )
but continued to receive the error above. In order to determine which file had a handle
open to that file I downloaded <a href="http://technet.microsoft.com/en-us/sysinternals/bb896655" target="_blank">Handle</a> from
the <a href="http://technet.microsoft.com/en-us/sysinternals" target="_blank">sysinternals
suite</a>. (<em>I actually already had the items downloaded inside of a Dropbox share
which I use between multiple computers.</em>) I then executed the command handle.exe
nlog and the results are shown below. Note: I had to open a command prompt window
to run handle.exe, for some reason it wasn’t working from a PowerShell prompt.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/Windows-how-to-determine-what-is-locking_EB5D/image_8.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/Windows-how-to-determine-what-is-locking_EB5D/image_thumb_3.png" width="805" height="299" />
          </a>
        </p>
        <p>
As you can see there was a rogue devenv.exe process holding on to the file. After
killing the process I was able to proceed.
</p>
        <p>
Sayed Ibrahim Hashimi <a href="http://twitter.com/sayedihashimi" target="_blank">@SayedIHashimi</a></p>
        <img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=fb09b691-0dce-4bf9-8db0-805e74bc0af2" />
      </body>
      <title>Windows how to determine what is locking a given file</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,fb09b691-0dce-4bf9-8db0-805e74bc0af2.aspx</guid>
      <link>http://sedodream.com/2012/05/05/WindowsHowToDetermineWhatIsLockingAGivenFile.aspx</link>
      <pubDate>Sat, 05 May 2012 23:53:04 GMT</pubDate>
      <description>&lt;p&gt;
Have you ever tried to perform an operation on a file (i.e. delete) just to be faced
with an error relating to the fact that an application is locking the file? This happens
to me a lot, including just now. I was writing some code and tried to switch branches
and was given the error below.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/Windows-how-to-determine-what-is-locking_EB5D/image_4.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/Windows-how-to-determine-what-is-locking_EB5D/image_thumb_1.png" width="903" height="51" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
So I closed down Visual Studio as well as IIS Express as I figured those were the
ones which had the lock on the file, and tried again (a few times actually &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://sedodream.com/content/binary/Windows-Live-Writer/Windows-how-to-determine-what-is-locking_EB5D/wlEmoticon-smile_2.png" /&gt; )
but continued to receive the error above. In order to determine which file had a handle
open to that file I downloaded &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb896655" target="_blank"&gt;Handle&lt;/a&gt; from
the &lt;a href="http://technet.microsoft.com/en-us/sysinternals" target="_blank"&gt;sysinternals
suite&lt;/a&gt;. (&lt;em&gt;I actually already had the items downloaded inside of a Dropbox share
which I use between multiple computers.&lt;/em&gt;) I then executed the command handle.exe
nlog and the results are shown below. Note: I had to open a command prompt window
to run handle.exe, for some reason it wasn’t working from a PowerShell prompt.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/Windows-how-to-determine-what-is-locking_EB5D/image_8.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/Windows-how-to-determine-what-is-locking_EB5D/image_thumb_3.png" width="805" height="299" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
As you can see there was a rogue devenv.exe process holding on to the file. After
killing the process I was able to proceed.
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi &lt;a href="http://twitter.com/sayedihashimi" target="_blank"&gt;@SayedIHashimi&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=fb09b691-0dce-4bf9-8db0-805e74bc0af2" /&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,fb09b691-0dce-4bf9-8db0-805e74bc0af2.aspx</comments>
      <category>diagnostic</category>
      <category>windows</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=9f1280ce-421d-4a59-b41b-d9c6e709f10e</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,9f1280ce-421d-4a59-b41b-d9c6e709f10e.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,9f1280ce-421d-4a59-b41b-d9c6e709f10e.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=9f1280ce-421d-4a59-b41b-d9c6e709f10e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’ve been using Git for my open source projects recently and have been loving it.
If you are like me and you like using the PowerShell prompt instead of the normal
command prompt then you have to install <a href="https://github.com/dahlbyk/posh-git" target="_blank">posh-git</a>.
posh-git extends the PowerShell prompt to include information about the git repository
and also makes remote operations simpler. After using git in this way I quickly noticed
that the colors were not very readable. For example take a look at the screen shot
below.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/git-customizing-colors-including-posh-gi_C69A/image_4.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/git-customizing-colors-including-posh-gi_C69A/image_thumb_1.png" width="737" height="279" />
          </a>
        </p>
        <p>
In the image above you can see that the text in dark red is difficult to read. This
text comes from two different places. For the text relating to modified and untracked
files, that is coming directly from git.exe and for the text after <strong>[master</strong> that
is coming from posh-git. In order to make this easier to read we have to modify the
color settings for both.
</p>
        <h3>Modifying text color settings for git.exe
</h3>
        <p>
When using git.exe you can configure the color settings using <a href="http://man.he.net/man1/git-config" target="_blank">git
config</a>. There are a bunch of color settings which you can control, which are all
listed on the manpage for git config. In my case I want to update the color for modified
files and untracked files, those can be configured with <strong>color.status.changed</strong> and <strong>color.status.untracked</strong> respectively.
The color options that you have to pick from include:
</p>
        <ul>
          <li>
normal</li>
          <li>
black</li>
          <li>
red</li>
          <li>
green</li>
          <li>
yellow</li>
          <li>
blue</li>
          <li>
magenta</li>
          <li>
cyan</li>
          <li>
white</li>
        </ul>
        <p>
In my case I wanted the text for those settings to be the same color as the master
text in the image above. In order to set the color you can use the syntax:
</p>
        <blockquote>
          <p>
            <font face="Consolas">git config &lt;color-to-update&gt; “foreground-color background-color
attribute”</font>
          </p>
        </blockquote>
        <p>
The attribute value can be any of these values; bold, dim, ul, blink and reverse.
</p>
        <p>
In my case I executed the following command:
</p>
        <blockquote>
          <p>
            <font face="Consolas">git config --global color.status.changed "cyan normal bold" 
<br />
git config --global color.status.untracked "cyan normal bold"</font>
          </p>
        </blockquote>
        <p>
Notice that I used the <em>--global</em> switch to indicate that I wanted the settings
to be persisted in the global .gitconfig file instead of the one for the specific
project that I was working on. So this got me to:
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/git-customizing-colors-including-posh-gi_C69A/image_6.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/git-customizing-colors-including-posh-gi_C69A/image_thumb_2.png" width="737" height="279" />
          </a>
        </p>
        <p>
Almost there, now I need to modify the color for the summary provided by posh-git.
A good resource for more info here is <a href="http://git-scm.com/book/ch7-1.html#Colors-in-Git">http://git-scm.com/book/ch7-1.html#Colors-in-Git</a>.
</p>
        <h3>Modifying text color for posh-git
</h3>
        <p>
posh-git stores all of it’s color settings in the $global:GitPromptSettings variable,
you can see them declared in the <a href="https://github.com/dahlbyk/posh-git/blob/master/GitPrompt.ps1" target="_blank">GitPrompt.ps1</a> file.
If you want to change the values for the colors you should not edit that file (that
file might get updated later). Instead all you need to do is to override the value
for the particular color after posh-git has been loaded. The best way to do this is
to edit your PowerShell profile. This file is executed every time you open a PS prompt.
You can find the location of this file by executing $profile in a PS prompt. In that
file you should see a line initializing posh-git in my case it was:
</p>
        <blockquote>
          <p>
            <font face="Consolas">. 'G:\Data\Development\OpenSource\posh-git\profile.example.ps1'</font>
          </p>
        </blockquote>
        <p>
You should place your customizations after this statement. So in my case I wanted
to change the summary text from dark red to yellow, so I added the following lines
to my PS profile.
</p>
        <blockquote>
          <p>
            <font face="Consolas">$global:GitPromptSettings.WorkingForegroundColor   
= [ConsoleColor]::Yellow 
<br />
$global:GitPromptSettings.UntrackedForegroundColor  = [ConsoleColor]::Yellow</font>
          </p>
        </blockquote>
        <p>
I closed the PS window and opened a new one and now here is the result.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/git-customizing-colors-including-posh-gi_C69A/image_8.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/git-customizing-colors-including-posh-gi_C69A/image_thumb_3.png" width="737" height="279" />
          </a>
        </p>
        <p>
Now that’s better!
</p>
        <p>
FYI if you are looking to install <a href="https://github.com/dahlbyk/posh-git" target="_blank">posh-git</a> you
can follow a simple walk through on Phil Haack’s blog at <a href="http://haacked.com/archive/2011/12/13/better-git-with-powershell.aspx" target="_blank">Better
Git with PowerShell</a>.
</p>
        <p>
I’d like to thank <a href="https://twitter.com/#!/bradwilson" target="_blank">Brad
Wilson</a> and <a href="https://twitter.com/#!/dahlbyk" target="_blank">Keith Dahlby</a> for
pointing me in the right direction regarding these settings.
</p>
        <p>
 
</p>
        <p>
Sayed Ibrahim Hashimi | <a href="http://twitter.com/sayedihashimi" target="_blank">@SayedIHashimi</a></p>
        <p>
          <a href="https://github.com/sayedihashimi" target="_blank">My Github account</a>
        </p>
        <img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=9f1280ce-421d-4a59-b41b-d9c6e709f10e" />
      </body>
      <title>Git customizing colors for Windows including posh-git</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,9f1280ce-421d-4a59-b41b-d9c6e709f10e.aspx</guid>
      <link>http://sedodream.com/2012/05/05/GitCustomizingColorsForWindowsIncludingPoshgit.aspx</link>
      <pubDate>Sat, 05 May 2012 21:48:23 GMT</pubDate>
      <description>&lt;p&gt;
I’ve been using Git for my open source projects recently and have been loving it.
If you are like me and you like using the PowerShell prompt instead of the normal
command prompt then you have to install &lt;a href="https://github.com/dahlbyk/posh-git" target="_blank"&gt;posh-git&lt;/a&gt;.
posh-git extends the PowerShell prompt to include information about the git repository
and also makes remote operations simpler. After using git in this way I quickly noticed
that the colors were not very readable. For example take a look at the screen shot
below.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/git-customizing-colors-including-posh-gi_C69A/image_4.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/git-customizing-colors-including-posh-gi_C69A/image_thumb_1.png" width="737" height="279" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
In the image above you can see that the text in dark red is difficult to read. This
text comes from two different places. For the text relating to modified and untracked
files, that is coming directly from git.exe and for the text after &lt;strong&gt;[master&lt;/strong&gt; that
is coming from posh-git. In order to make this easier to read we have to modify the
color settings for both.
&lt;/p&gt;
&lt;h3&gt;Modifying text color settings for git.exe
&lt;/h3&gt;
&lt;p&gt;
When using git.exe you can configure the color settings using &lt;a href="http://man.he.net/man1/git-config" target="_blank"&gt;git
config&lt;/a&gt;. There are a bunch of color settings which you can control, which are all
listed on the manpage for git config. In my case I want to update the color for modified
files and untracked files, those can be configured with &lt;strong&gt;color.status.changed&lt;/strong&gt; and &lt;strong&gt;color.status.untracked&lt;/strong&gt; respectively.
The color options that you have to pick from include:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
normal&lt;/li&gt;
&lt;li&gt;
black&lt;/li&gt;
&lt;li&gt;
red&lt;/li&gt;
&lt;li&gt;
green&lt;/li&gt;
&lt;li&gt;
yellow&lt;/li&gt;
&lt;li&gt;
blue&lt;/li&gt;
&lt;li&gt;
magenta&lt;/li&gt;
&lt;li&gt;
cyan&lt;/li&gt;
&lt;li&gt;
white&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
In my case I wanted the text for those settings to be the same color as the master
text in the image above. In order to set the color you can use the syntax:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Consolas"&gt;git config &amp;lt;color-to-update&amp;gt; “foreground-color background-color
attribute”&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
The attribute value can be any of these values; bold, dim, ul, blink and reverse.
&lt;/p&gt;
&lt;p&gt;
In my case I executed the following command:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Consolas"&gt;git config --global color.status.changed &amp;quot;cyan normal bold&amp;quot; 
&lt;br /&gt;
git config --global color.status.untracked &amp;quot;cyan normal bold&amp;quot;&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
Notice that I used the &lt;em&gt;--global&lt;/em&gt; switch to indicate that I wanted the settings
to be persisted in the global .gitconfig file instead of the one for the specific
project that I was working on. So this got me to:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/git-customizing-colors-including-posh-gi_C69A/image_6.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/git-customizing-colors-including-posh-gi_C69A/image_thumb_2.png" width="737" height="279" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Almost there, now I need to modify the color for the summary provided by posh-git.
A good resource for more info here is &lt;a href="http://git-scm.com/book/ch7-1.html#Colors-in-Git"&gt;http://git-scm.com/book/ch7-1.html#Colors-in-Git&lt;/a&gt;.
&lt;/p&gt;
&lt;h3&gt;Modifying text color for posh-git
&lt;/h3&gt;
&lt;p&gt;
posh-git stores all of it’s color settings in the $global:GitPromptSettings variable,
you can see them declared in the &lt;a href="https://github.com/dahlbyk/posh-git/blob/master/GitPrompt.ps1" target="_blank"&gt;GitPrompt.ps1&lt;/a&gt; file.
If you want to change the values for the colors you should not edit that file (that
file might get updated later). Instead all you need to do is to override the value
for the particular color after posh-git has been loaded. The best way to do this is
to edit your PowerShell profile. This file is executed every time you open a PS prompt.
You can find the location of this file by executing $profile in a PS prompt. In that
file you should see a line initializing posh-git in my case it was:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Consolas"&gt;. 'G:\Data\Development\OpenSource\posh-git\profile.example.ps1'&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
You should place your customizations after this statement. So in my case I wanted
to change the summary text from dark red to yellow, so I added the following lines
to my PS profile.
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Consolas"&gt;$global:GitPromptSettings.WorkingForegroundColor&amp;#160;&amp;#160;&amp;#160;
= [ConsoleColor]::Yellow 
&lt;br /&gt;
$global:GitPromptSettings.UntrackedForegroundColor&amp;#160; = [ConsoleColor]::Yellow&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
I closed the PS window and opened a new one and now here is the result.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/git-customizing-colors-including-posh-gi_C69A/image_8.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/git-customizing-colors-including-posh-gi_C69A/image_thumb_3.png" width="737" height="279" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Now that’s better!
&lt;/p&gt;
&lt;p&gt;
FYI if you are looking to install &lt;a href="https://github.com/dahlbyk/posh-git" target="_blank"&gt;posh-git&lt;/a&gt; you
can follow a simple walk through on Phil Haack’s blog at &lt;a href="http://haacked.com/archive/2011/12/13/better-git-with-powershell.aspx" target="_blank"&gt;Better
Git with PowerShell&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
I’d like to thank &lt;a href="https://twitter.com/#!/bradwilson" target="_blank"&gt;Brad
Wilson&lt;/a&gt; and &lt;a href="https://twitter.com/#!/dahlbyk" target="_blank"&gt;Keith Dahlby&lt;/a&gt; for
pointing me in the right direction regarding these settings.
&lt;/p&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi | &lt;a href="http://twitter.com/sayedihashimi" target="_blank"&gt;@SayedIHashimi&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="https://github.com/sayedihashimi" target="_blank"&gt;My Github account&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=9f1280ce-421d-4a59-b41b-d9c6e709f10e" /&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,9f1280ce-421d-4a59-b41b-d9c6e709f10e.aspx</comments>
      <category>git</category>
      <category>posh-git</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=c2bf4342-0153-4f4f-aefe-15abb73f400f</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,c2bf4342-0153-4f4f-aefe-15abb73f400f.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,c2bf4342-0153-4f4f-aefe-15abb73f400f.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=c2bf4342-0153-4f4f-aefe-15abb73f400f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In case you are not familiar with <a href="http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5">SlowCheetah</a>,
it is a Visual Studio extension which allows you to transform app.config files in
the same way that web.config files are. More info on the project page <a href="http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5">http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5</a>.
</p>
        <p>
I wanted to let everyone know that I have updated <a href="http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5">SlowCheetah</a> to
support Visual Studio 11 and I have also placed the project on github at <a href="https://github.com/sayedihashimi/slow-cheetah">https://github.com/sayedihashimi/slow-cheetah</a>.
Regarding the VS 11 support there is one known issue that we currently <a href="https://github.com/sayedihashimi/slow-cheetah/issues/1">do
not support the preview functionality on VS 11</a>. This is an item which we will
be fixing for the next release.
</p>
        <p>
 
</p>
        <p>
Thanks, 
<br />
Sayed Ibrahim Hashimi <a href="http://twitter.com/sayedihashimi">@SayedIHashimi</a></p>
        <p>
          <em>Reminder: even though I work for Microsoft this is a personal project and not
formally affiliated with Microsoft</em>
        </p>
        <img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=c2bf4342-0153-4f4f-aefe-15abb73f400f" />
      </body>
      <title>SlowCheetah VS 11 support and now on github</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,c2bf4342-0153-4f4f-aefe-15abb73f400f.aspx</guid>
      <link>http://sedodream.com/2012/04/27/SlowCheetahVS11SupportAndNowOnGithub.aspx</link>
      <pubDate>Fri, 27 Apr 2012 18:52:02 GMT</pubDate>
      <description>&lt;p&gt;
In case you are not familiar with &lt;a href="http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5"&gt;SlowCheetah&lt;/a&gt;,
it is a Visual Studio extension which allows you to transform app.config files in
the same way that web.config files are. More info on the project page &lt;a href="http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5"&gt;http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
I wanted to let everyone know that I have updated &lt;a href="http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5"&gt;SlowCheetah&lt;/a&gt; to
support Visual Studio 11 and I have also placed the project on github at &lt;a href="https://github.com/sayedihashimi/slow-cheetah"&gt;https://github.com/sayedihashimi/slow-cheetah&lt;/a&gt;.
Regarding the VS 11 support there is one known issue that we currently &lt;a href="https://github.com/sayedihashimi/slow-cheetah/issues/1"&gt;do
not support the preview functionality on VS 11&lt;/a&gt;. This is an item which we will
be fixing for the next release.
&lt;/p&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
Thanks, 
&lt;br /&gt;
Sayed Ibrahim Hashimi &lt;a href="http://twitter.com/sayedihashimi"&gt;@SayedIHashimi&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Reminder: even though I work for Microsoft this is a personal project and not
formally affiliated with Microsoft&lt;/em&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=c2bf4342-0153-4f4f-aefe-15abb73f400f" /&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,c2bf4342-0153-4f4f-aefe-15abb73f400f.aspx</comments>
      <category>MSBuild</category>
      <category>SlowCheetah</category>
      <category>Visual Studio 11</category>
      <category>Visual Studio 2010</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=aba5b929-9e99-4e68-9b2a-4ae5430d21b1</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,aba5b929-9e99-4e68-9b2a-4ae5430d21b1.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,aba5b929-9e99-4e68-9b2a-4ae5430d21b1.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=aba5b929-9e99-4e68-9b2a-4ae5430d21b1</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
If you have tried out the web publish feature in Visual Studio then you may have noticed
the message seen in the image towards the end of the post in the database section.
</p>
        <p>
We did not have time for VS 11 beta to light up these features, but if you want a
sneak peak of the behavior then take a look at the channel 9 video I posted recently <a href="http://channel9.msdn.com/Shows/Web+Camps+TV/Dirt-Simple-Web-and-Database-Deployment-in-Visual-Studio-11">Dirt
Simple Web and Database Deployment in Visual Studio 11</a>. If you have any questions/feedback
feel free to send me an email: sayedha [at] {Microsoft}dotCOM.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/9905be4d4d55_B987/image_4.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/9905be4d4d55_B987/image_thumb_1.png" width="724" height="564" />
          </a>
        </p>
        <p>
Thanks,
</p>
        <p>
Sayed Ibrahim Hashimi <a href="http://twitter.com/sayedihashimi">@SayedIHashimi</a></p>
        <img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=aba5b929-9e99-4e68-9b2a-4ae5430d21b1" />
      </body>
      <title>Visual Studio 11 Web Publish database section</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,aba5b929-9e99-4e68-9b2a-4ae5430d21b1.aspx</guid>
      <link>http://sedodream.com/2012/04/22/VisualStudio11WebPublishDatabaseSection.aspx</link>
      <pubDate>Sun, 22 Apr 2012 20:15:30 GMT</pubDate>
      <description>&lt;p&gt;
If you have tried out the web publish feature in Visual Studio then you may have noticed
the message seen in the image towards the end of the post in the database section.
&lt;/p&gt;
&lt;p&gt;
We did not have time for VS 11 beta to light up these features, but if you want a
sneak peak of the behavior then take a look at the channel 9 video I posted recently &lt;a href="http://channel9.msdn.com/Shows/Web+Camps+TV/Dirt-Simple-Web-and-Database-Deployment-in-Visual-Studio-11"&gt;Dirt
Simple Web and Database Deployment in Visual Studio 11&lt;/a&gt;. If you have any questions/feedback
feel free to send me an email: sayedha [at] {Microsoft}dotCOM.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/9905be4d4d55_B987/image_4.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/9905be4d4d55_B987/image_thumb_1.png" width="724" height="564" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Thanks,
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi &lt;a href="http://twitter.com/sayedihashimi"&gt;@SayedIHashimi&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=aba5b929-9e99-4e68-9b2a-4ae5430d21b1" /&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,aba5b929-9e99-4e68-9b2a-4ae5430d21b1.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=eed06067-7512-4bbc-bec5-644ba2657885</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,eed06067-7512-4bbc-bec5-644ba2657885.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,eed06067-7512-4bbc-bec5-644ba2657885.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=eed06067-7512-4bbc-bec5-644ba2657885</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Recently I recorded a video on Channel 9 with Brady Gaster <a href="http://channel9.msdn.com/Shows/Web+Camps+TV/Dirt-Simple-Web-and-Database-Deployment-in-Visual-Studio-11" target="_blank">Dirt
Simple Web and Database Deployment in Visual Studio 11</a>. In this video I show the
work that we have done to enable Entity Framework Code First migrations during publish
and I also cover the investments that we are making regarding incremental database
schema publish when you are not using EF Code First. If you get a chance I’d love
for you to watch the video and give feedback regarding the direction that we are taking
with VS Web Publishing.
</p>
        <p>
Thanks, 
<br />
Sayed Ibrahim Hashimi <a href="twitter.com/sayedihashimi">@SayedIHashimi</a></p>
        <img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=eed06067-7512-4bbc-bec5-644ba2657885" />
      </body>
      <title>Video about upcoming Visual Studio 11 web publish updates</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,eed06067-7512-4bbc-bec5-644ba2657885.aspx</guid>
      <link>http://sedodream.com/2012/04/22/VideoAboutUpcomingVisualStudio11WebPublishUpdates.aspx</link>
      <pubDate>Sun, 22 Apr 2012 19:15:40 GMT</pubDate>
      <description>&lt;p&gt;
Recently I recorded a video on Channel 9 with Brady Gaster &lt;a href="http://channel9.msdn.com/Shows/Web+Camps+TV/Dirt-Simple-Web-and-Database-Deployment-in-Visual-Studio-11" target="_blank"&gt;Dirt
Simple Web and Database Deployment in Visual Studio 11&lt;/a&gt;. In this video I show the
work that we have done to enable Entity Framework Code First migrations during publish
and I also cover the investments that we are making regarding incremental database
schema publish when you are not using EF Code First. If you get a chance I’d love
for you to watch the video and give feedback regarding the direction that we are taking
with VS Web Publishing.
&lt;/p&gt;
&lt;p&gt;
Thanks, 
&lt;br /&gt;
Sayed Ibrahim Hashimi &lt;a href="twitter.com/sayedihashimi"&gt;@SayedIHashimi&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=eed06067-7512-4bbc-bec5-644ba2657885" /&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,eed06067-7512-4bbc-bec5-644ba2657885.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=f623d885-ebb6-45c8-b0a3-f2d91e400d26</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,f623d885-ebb6-45c8-b0a3-f2d91e400d26.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,f623d885-ebb6-45c8-b0a3-f2d91e400d26.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=f623d885-ebb6-45c8-b0a3-f2d91e400d26</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
A couple months ago I <a href="http://sedodream.com/2011/12/24/PackageOncePublishAnywhere.aspx" target="_blank">blogged
about a Package-Web</a> which is a NuGet package that extends the web packaging process
in Visual Studio to enable you to create a single package which can be published to
multiple environments (<em>it captures all of your web.config transforms and has the
ability to transform on non-dev machines</em>). Since that release I have updated
the project and tonight I created a video which shows the features a bit you can <a href="http://youtu.be/-LvUJFI8CzM" target="_blank">check
it out on Youtube</a>. It’s embedded below.
</p>
        <iframe height="315" src="http://www.youtube.com/embed/-LvUJFI8CzM" frameborder="0" width="560" allowfullscreen="allowfullscreen">
        </iframe>
        <p>
          <strong>
            <font size="3">You can install this via NuGet, the package name is PackageWeb.</font>
          </strong>
        </p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/Package-web-updated-and-video-below_1440C/image_2.png">
            <img style="background-image: none; border-right-width: 0px; 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/Package-web-updated-and-video-below_1440C/image_thumb.png" width="745" height="71" />
          </a>
        </p>
        <p>
Package-Web is an open source project and you can find it on my github account at <a href="https://github.com/sayedihashimi/package-web">https://github.com/sayedihashimi/package-web</a>.
</p>
        <p>
Thanks, 
<br />
Sayed Ibrahim Hashimi <a href="https://twitter.com/#!/sayedihashimi" target="_blank">@SayedIHashimi</a></p>
        <img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=f623d885-ebb6-45c8-b0a3-f2d91e400d26" />
      </body>
      <title>Package web updated and video below</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,f623d885-ebb6-45c8-b0a3-f2d91e400d26.aspx</guid>
      <link>http://sedodream.com/2012/03/14/PackageWebUpdatedAndVideoBelow.aspx</link>
      <pubDate>Wed, 14 Mar 2012 06:08:57 GMT</pubDate>
      <description>&lt;p&gt;
A couple months ago I &lt;a href="http://sedodream.com/2011/12/24/PackageOncePublishAnywhere.aspx" target="_blank"&gt;blogged
about a Package-Web&lt;/a&gt; which is a NuGet package that extends the web packaging process
in Visual Studio to enable you to create a single package which can be published to
multiple environments (&lt;em&gt;it captures all of your web.config transforms and has the
ability to transform on non-dev machines&lt;/em&gt;). Since that release I have updated
the project and tonight I created a video which shows the features a bit you can &lt;a href="http://youtu.be/-LvUJFI8CzM" target="_blank"&gt;check
it out on Youtube&lt;/a&gt;. It’s embedded below.
&lt;/p&gt;
&lt;iframe height="315" src="http://www.youtube.com/embed/-LvUJFI8CzM" frameborder="0" width="560" allowfullscreen="allowfullscreen"&gt;
&lt;/iframe&gt;
&lt;p&gt;
&lt;strong&gt;&lt;font size="3"&gt;You can install this via NuGet, the package name is PackageWeb.&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/Package-web-updated-and-video-below_1440C/image_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; 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/Package-web-updated-and-video-below_1440C/image_thumb.png" width="745" height="71" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Package-Web is an open source project and you can find it on my github account at &lt;a href="https://github.com/sayedihashimi/package-web"&gt;https://github.com/sayedihashimi/package-web&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Thanks, 
&lt;br /&gt;
Sayed Ibrahim Hashimi &lt;a href="https://twitter.com/#!/sayedihashimi" target="_blank"&gt;@SayedIHashimi&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=f623d885-ebb6-45c8-b0a3-f2d91e400d26" /&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,f623d885-ebb6-45c8-b0a3-f2d91e400d26.aspx</comments>
      <category>MSBuild</category>
      <category>MSDeploy</category>
      <category>Visual Studio</category>
      <category>web</category>
      <category>Web Deployment Tool</category>
      <category>Web Development</category>
      <category>Web Publishing Pipeline</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=d9d1333e-0ff0-4fb4-b92a-72631e92442f</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,d9d1333e-0ff0-4fb4-b92a-72631e92442f.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,d9d1333e-0ff0-4fb4-b92a-72631e92442f.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=d9d1333e-0ff0-4fb4-b92a-72631e92442f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The other day I saw a question on StackOverflow (link in resources below) asking How
you can create a Web Deploy (AKA MSDeploy) package when publishing a ClickOnce project.
The easiest way to do this is to use the Web Deploy command line utility, msdeploy.exe.
With the command line you can easily create an MSDeploy package from a folder with
a command like the following:
</p>
        <pre class="brush: csharp;">    %msdeploy% 
      -verb:sync 
      -source:contentPath="C:\Temp\_NET\WebPackageWithClickOnce\WebPackageWithClickOnce\bin\Debug\app.publish" 
      -dest:package="C:\Temp\_NET\WebPackageWithClickOnce\WebPackageWithClickOnce\bin\Debug\co-pkg.zip"</pre>
        <p>
 
</p>
        <p>
Here you can see that I’m using the sync verb, along with a contentPath provider (<em>which
points to a folder</em>) as the source and the destination is using the package provider,
this point to where I want the package to be stored.
</p>
        <p>
Now that we understand how to create an MSDeploy package from a folder we need to
extend the ClickOnce publish process to create a package. I’m not a ClickOnce expert,
but the ClickOnce publish process is captured in MSBuild so after investigating for
a bit I found the following relevant details.
</p>
        <ul>
          <li>
The ClickOnce publish process is contained in the Microsoft.Common.targets file</li>
          <li>
The ClickOnce publish process is tied together through the <strong>Publish</strong> target</li>
          <li>
ClickOnce prepares the files to be published in a folder under bin named app.publish
which is governed by the MSBuild property <strong>PublishDir</strong></li>
        </ul>
        <p>
Now that we know what target to extend as well as what property we can use to refer
to the folder which has the content we can complete sample. We need to edit the project
file. Below is the full contents which I have placed at the bottom of the project
file (right above &lt;/Project&gt;).
</p>
        <pre class="brush: xml;">  &lt;PropertyGroup&gt;
    &lt;WebDeployPackageName Condition=" '$(WebDeployPackageName)'=='' "&gt;$(MSBuildProjectName).zip&lt;/WebDeployPackageName&gt;
    &lt;!--Unless specified otherwise, the tools will go to HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1 to get the installpath for msdeploy.exe.--&gt;
    &lt;MSDeployPath Condition="'$(MSDeployPath)'==''"&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\3@InstallPath)&lt;/MSDeployPath&gt;
    &lt;MSDeployPath Condition="'$(MSDeployPath)'==''"&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\2@InstallPath)&lt;/MSDeployPath&gt;
    &lt;MSDeployPath Condition="'$(MSDeployPath)'==''"&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1@InstallPath)&lt;/MSDeployPath&gt;
    &lt;MSDeployExe Condition=" '$(MSDeployExe)'=='' "&gt;$(MSDeployPath)msdeploy.exe&lt;/MSDeployExe&gt;
  &lt;/PropertyGroup&gt;
  &lt;Target Name="CreateWebDeployPackage" AfterTargets="Publish" DependsOnTargets="Publish"&gt;
    &lt;!--
    %msdeploy% 
      -verb:sync 
      -source:contentPath="C:\Temp\_NET\WebPackageWithClickOnce\WebPackageWithClickOnce\bin\Debug\app.publish" 
      -dest:package="C:\Temp\_NET\WebPackageWithClickOnce\WebPackageWithClickOnce\bin\Debug\co-pkg.zip"
      --&gt;
    &lt;PropertyGroup&gt;
      &lt;Cmd&gt;"$(MSDeployExe)" -verb:sync -source:contentPath="$(MSBuildProjectDirectory)\$(PublishDir)" -dest:package="$(OutDir)$(WebDeployPackageName)"&lt;/Cmd&gt;
    &lt;/PropertyGroup&gt;
    &lt;Message Text="Creating web deploy package with command: $(Cmd)" /&gt;
    &lt;Exec Command="$(Cmd)" /&gt;
  &lt;/Target&gt;</pre>
        <p>
Here I’ve created a couple properties as well as a new target, CreateWebDeployPackage.
I have declared the property WebDeployPackageName which will be the name (excluding
path) of the Web Deploy package which gets created. This defaults to the name of the
project, but you can override it if you want. Next I define the property, MSDeployPath,
which points to msdeploy.exe. It will pick the latest version.
</p>
        <p>
The CreateWebDeployPackage target just constructs the full command line call which
needs to be executed and invokes it using the Exec MSBuild task. There are a couple
subtle details on the target itself though which are worth pointing out. The target
has declared <strong>AfterTargets=”Publish”</strong> which means that it will be invoked
after the Publish target. It also declares <strong>DependsOnTargets=”Publish”</strong>.
Which means that whenever the target gets invoked that Publish will need to be executed
before <strong>CreateWebDeployPackage</strong>. 
</p>
        <p>
Now that we have defined these updates when you publish your ClickOnce project (wither
through Visual Studio or the command line/build servers) a Web Deploy package will
be generated in the output folder which you can use to incrementally publish your
ClickOnce app to your web server. You can find the latest version of this sample on
my <a href="https://github.com/sayedihashimi/sayed-samples/tree/master/ClickOnceCreateWebPackage">github
repository</a>.
</p>
        <p>
Sayed Ibrahim Hashimi <a href="https://twitter.com/#!/sayedihashimi">@SayedIHashimi</a></p>
        <p>
Resources
</p>
        <ul>
          <li>
StackOverflow question: <a href="http://stackoverflow.com/q/9292986/105999">Create
a clickonce webdeploy package</a></li>
          <li>
            <a href="http://technet.microsoft.com/en-us/library/dd569106(WS.10).aspx">MSDeploy.exe
verb</a>
          </li>
          <li>
            <a href="http://technet.microsoft.com/en-us/library/dd569034(WS.10).aspx">MSDeploy
contentPath provider</a>
          </li>
          <li>
            <a href="http://technet.microsoft.com/en-us/library/dd569019(WS.10).aspx">MSDeploy
package provider</a>
          </li>
          <li>
            <a href="http://msdn.microsoft.com/en-us/library/x8zx72cd.aspx">MSBuild Exec task</a>
          </li>
        </ul>
        <img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=d9d1333e-0ff0-4fb4-b92a-72631e92442f" />
      </body>
      <title>How to create a Web Deploy package when publishing a ClickOnce project</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,d9d1333e-0ff0-4fb4-b92a-72631e92442f.aspx</guid>
      <link>http://sedodream.com/2012/02/18/HowToCreateAWebDeployPackageWhenPublishingAClickOnceProject.aspx</link>
      <pubDate>Sat, 18 Feb 2012 18:47:30 GMT</pubDate>
      <description>&lt;p&gt;
The other day I saw a question on StackOverflow (link in resources below) asking How
you can create a Web Deploy (AKA MSDeploy) package when publishing a ClickOnce project.
The easiest way to do this is to use the Web Deploy command line utility, msdeploy.exe.
With the command line you can easily create an MSDeploy package from a folder with
a command like the following:
&lt;/p&gt;
&lt;pre class="brush: csharp;"&gt;    %msdeploy% 
      -verb:sync 
      -source:contentPath=&amp;quot;C:\Temp\_NET\WebPackageWithClickOnce\WebPackageWithClickOnce\bin\Debug\app.publish&amp;quot; 
      -dest:package=&amp;quot;C:\Temp\_NET\WebPackageWithClickOnce\WebPackageWithClickOnce\bin\Debug\co-pkg.zip&amp;quot;&lt;/pre&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
Here you can see that I’m using the sync verb, along with a contentPath provider (&lt;em&gt;which
points to a folder&lt;/em&gt;) as the source and the destination is using the package provider,
this point to where I want the package to be stored.
&lt;/p&gt;
&lt;p&gt;
Now that we understand how to create an MSDeploy package from a folder we need to
extend the ClickOnce publish process to create a package. I’m not a ClickOnce expert,
but the ClickOnce publish process is captured in MSBuild so after investigating for
a bit I found the following relevant details.
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
The ClickOnce publish process is contained in the Microsoft.Common.targets file&lt;/li&gt;
&lt;li&gt;
The ClickOnce publish process is tied together through the &lt;strong&gt;Publish&lt;/strong&gt; target&lt;/li&gt;
&lt;li&gt;
ClickOnce prepares the files to be published in a folder under bin named app.publish
which is governed by the MSBuild property &lt;strong&gt;PublishDir&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Now that we know what target to extend as well as what property we can use to refer
to the folder which has the content we can complete sample. We need to edit the project
file. Below is the full contents which I have placed at the bottom of the project
file (right above &amp;lt;/Project&amp;gt;).
&lt;/p&gt;
&lt;pre class="brush: xml;"&gt;  &amp;lt;PropertyGroup&amp;gt;
    &amp;lt;WebDeployPackageName Condition=&amp;quot; '$(WebDeployPackageName)'=='' &amp;quot;&amp;gt;$(MSBuildProjectName).zip&amp;lt;/WebDeployPackageName&amp;gt;
    &amp;lt;!--Unless specified otherwise, the tools will go to HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1 to get the installpath for msdeploy.exe.--&amp;gt;
    &amp;lt;MSDeployPath Condition=&amp;quot;'$(MSDeployPath)'==''&amp;quot;&amp;gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\3@InstallPath)&amp;lt;/MSDeployPath&amp;gt;
    &amp;lt;MSDeployPath Condition=&amp;quot;'$(MSDeployPath)'==''&amp;quot;&amp;gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\2@InstallPath)&amp;lt;/MSDeployPath&amp;gt;
    &amp;lt;MSDeployPath Condition=&amp;quot;'$(MSDeployPath)'==''&amp;quot;&amp;gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1@InstallPath)&amp;lt;/MSDeployPath&amp;gt;
    &amp;lt;MSDeployExe Condition=&amp;quot; '$(MSDeployExe)'=='' &amp;quot;&amp;gt;$(MSDeployPath)msdeploy.exe&amp;lt;/MSDeployExe&amp;gt;
  &amp;lt;/PropertyGroup&amp;gt;
  &amp;lt;Target Name=&amp;quot;CreateWebDeployPackage&amp;quot; AfterTargets=&amp;quot;Publish&amp;quot; DependsOnTargets=&amp;quot;Publish&amp;quot;&amp;gt;
    &amp;lt;!--
    %msdeploy% 
      -verb:sync 
      -source:contentPath=&amp;quot;C:\Temp\_NET\WebPackageWithClickOnce\WebPackageWithClickOnce\bin\Debug\app.publish&amp;quot; 
      -dest:package=&amp;quot;C:\Temp\_NET\WebPackageWithClickOnce\WebPackageWithClickOnce\bin\Debug\co-pkg.zip&amp;quot;
      --&amp;gt;
    &amp;lt;PropertyGroup&amp;gt;
      &amp;lt;Cmd&amp;gt;&amp;quot;$(MSDeployExe)&amp;quot; -verb:sync -source:contentPath=&amp;quot;$(MSBuildProjectDirectory)\$(PublishDir)&amp;quot; -dest:package=&amp;quot;$(OutDir)$(WebDeployPackageName)&amp;quot;&amp;lt;/Cmd&amp;gt;
    &amp;lt;/PropertyGroup&amp;gt;
    &amp;lt;Message Text=&amp;quot;Creating web deploy package with command: $(Cmd)&amp;quot; /&amp;gt;
    &amp;lt;Exec Command=&amp;quot;$(Cmd)&amp;quot; /&amp;gt;
  &amp;lt;/Target&amp;gt;&lt;/pre&gt;
&lt;p&gt;
Here I’ve created a couple properties as well as a new target, CreateWebDeployPackage.
I have declared the property WebDeployPackageName which will be the name (excluding
path) of the Web Deploy package which gets created. This defaults to the name of the
project, but you can override it if you want. Next I define the property, MSDeployPath,
which points to msdeploy.exe. It will pick the latest version.
&lt;/p&gt;
&lt;p&gt;
The CreateWebDeployPackage target just constructs the full command line call which
needs to be executed and invokes it using the Exec MSBuild task. There are a couple
subtle details on the target itself though which are worth pointing out. The target
has declared &lt;strong&gt;AfterTargets=”Publish”&lt;/strong&gt; which means that it will be invoked
after the Publish target. It also declares &lt;strong&gt;DependsOnTargets=”Publish”&lt;/strong&gt;.
Which means that whenever the target gets invoked that Publish will need to be executed
before &lt;strong&gt;CreateWebDeployPackage&lt;/strong&gt;. 
&lt;/p&gt;
&lt;p&gt;
Now that we have defined these updates when you publish your ClickOnce project (wither
through Visual Studio or the command line/build servers) a Web Deploy package will
be generated in the output folder which you can use to incrementally publish your
ClickOnce app to your web server. You can find the latest version of this sample on
my &lt;a href="https://github.com/sayedihashimi/sayed-samples/tree/master/ClickOnceCreateWebPackage"&gt;github
repository&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi &lt;a href="https://twitter.com/#!/sayedihashimi"&gt;@SayedIHashimi&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Resources
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
StackOverflow question: &lt;a href="http://stackoverflow.com/q/9292986/105999"&gt;Create
a clickonce webdeploy package&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://technet.microsoft.com/en-us/library/dd569106(WS.10).aspx"&gt;MSDeploy.exe
verb&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://technet.microsoft.com/en-us/library/dd569034(WS.10).aspx"&gt;MSDeploy
contentPath provider&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://technet.microsoft.com/en-us/library/dd569019(WS.10).aspx"&gt;MSDeploy
package provider&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://msdn.microsoft.com/en-us/library/x8zx72cd.aspx"&gt;MSBuild Exec task&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=d9d1333e-0ff0-4fb4-b92a-72631e92442f" /&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,d9d1333e-0ff0-4fb4-b92a-72631e92442f.aspx</comments>
      <category>ClickOnce</category>
      <category>IIS</category>
      <category>Microsoft</category>
      <category>MSBuild</category>
      <category>MSDeploy</category>
      <category>web</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=c3aa839b-d7dd-4847-b7ad-af347e1e86fc</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,c3aa839b-d7dd-4847-b7ad-af347e1e86fc.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,c3aa839b-d7dd-4847-b7ad-af347e1e86fc.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=c3aa839b-d7dd-4847-b7ad-af347e1e86fc</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The other day I saw a question posted on StackOverflow (<em>link to question below
in resources section</em>) asking if it was possible to update web.config using MSDeploy.
I actually used a technique where I updated a single file in one of my previous posts
at <a href="http://sedodream.com/2012/01/08/HowToTakeYourWebAppOfflineDuringPublishing.aspx">How
to take your web app offline during publishing</a> but it wasn’t called out too much.
In any case I’ll show you how you can update a single file (in this case web.config)
using MSDeploy.
</p>
        <p>
You can use the <a href="http://technet.microsoft.com/en-us/library/dd569034(WS.10).aspx">contentPath
provider</a> to facilitate updating a single file. Using contentPath you can sync
either a single file or an entire folder. You can also use IIS app paths to resolve
where the file/folder resides. For example if I have a web.config file in a local
folder named “C:\Data\Personal\My Repo\sayed-samples\UpdateWebConfig” and I want to
update my IIS site <strong>UpdateWebCfg </strong>running in the <strong>Default Web
Site </strong>on my folder I would use the command shown below.
</p>
        <pre class="brush: csharp;">%msdeploy% -verb:sync -source:contentPath="C:\Data\Personal\My Repo\sayed-samples\UpdateWebConfig\web.config" -dest:contentPath="Default Web Site/UpdateWebCfg/web.config"</pre>
        <p>
From the command above you can see that I set the source content path to the local
file and the dest content path using the IIS path <strong>{SiteName}/{AppName}/{file-path}</strong>.
In this case I am updating a site running in IIS on my local machine. In order to
update one that is running on a remote machine you will have to add ComputerName and
possibly some other values to the –dest argument.
</p>
        <p>
You can view the latest sources for this sample at my github repo, link is below.
</p>
        <p>
 
</p>
        <p>
Hope that helps!
</p>
        <p>
Sayed Ibrahim Hashimi – <a href="https://twitter.com/#!/sayedihashimi">@SayedIHashimi</a></p>
        <p>
Resources:
</p>
        <ul>
          <li>
            <a href="http://stackoverflow.com/questions/8803688/is-it-possible-to-modify-web-config-of-existing-site-using-msdeploy">StackOverflow
question – How to update web.config</a>
          </li>
          <li>
            <a href="https://github.com/sayedihashimi/sayed-samples/tree/master/UpdateWebConfig">Latest
sources for this sample on my github account</a>
          </li>
        </ul>
        <img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=c3aa839b-d7dd-4847-b7ad-af347e1e86fc" />
      </body>
      <title>How to update a single file using Web Deploy (MSDeploy)</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,c3aa839b-d7dd-4847-b7ad-af347e1e86fc.aspx</guid>
      <link>http://sedodream.com/2012/02/14/HowToUpdateASingleFileUsingWebDeployMSDeploy.aspx</link>
      <pubDate>Tue, 14 Feb 2012 19:17:30 GMT</pubDate>
      <description>&lt;p&gt;
The other day I saw a question posted on StackOverflow (&lt;em&gt;link to question below
in resources section&lt;/em&gt;) asking if it was possible to update web.config using MSDeploy.
I actually used a technique where I updated a single file in one of my previous posts
at &lt;a href="http://sedodream.com/2012/01/08/HowToTakeYourWebAppOfflineDuringPublishing.aspx"&gt;How
to take your web app offline during publishing&lt;/a&gt; but it wasn’t called out too much.
In any case I’ll show you how you can update a single file (in this case web.config)
using MSDeploy.
&lt;/p&gt;
&lt;p&gt;
You can use the &lt;a href="http://technet.microsoft.com/en-us/library/dd569034(WS.10).aspx"&gt;contentPath
provider&lt;/a&gt; to facilitate updating a single file. Using contentPath you can sync
either a single file or an entire folder. You can also use IIS app paths to resolve
where the file/folder resides. For example if I have a web.config file in a local
folder named “C:\Data\Personal\My Repo\sayed-samples\UpdateWebConfig” and I want to
update my IIS site &lt;strong&gt;UpdateWebCfg &lt;/strong&gt;running in the &lt;strong&gt;Default Web
Site &lt;/strong&gt;on my folder I would use the command shown below.
&lt;/p&gt;
&lt;pre class="brush: csharp;"&gt;%msdeploy% -verb:sync -source:contentPath=&amp;quot;C:\Data\Personal\My Repo\sayed-samples\UpdateWebConfig\web.config&amp;quot; -dest:contentPath=&amp;quot;Default Web Site/UpdateWebCfg/web.config&amp;quot;&lt;/pre&gt;
&lt;p&gt;
From the command above you can see that I set the source content path to the local
file and the dest content path using the IIS path &lt;strong&gt;{SiteName}/{AppName}/{file-path}&lt;/strong&gt;.
In this case I am updating a site running in IIS on my local machine. In order to
update one that is running on a remote machine you will have to add ComputerName and
possibly some other values to the –dest argument.
&lt;/p&gt;
&lt;p&gt;
You can view the latest sources for this sample at my github repo, link is below.
&lt;/p&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
Hope that helps!
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi – &lt;a href="https://twitter.com/#!/sayedihashimi"&gt;@SayedIHashimi&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Resources:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://stackoverflow.com/questions/8803688/is-it-possible-to-modify-web-config-of-existing-site-using-msdeploy"&gt;StackOverflow
question – How to update web.config&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/sayedihashimi/sayed-samples/tree/master/UpdateWebConfig"&gt;Latest
sources for this sample on my github account&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=c3aa839b-d7dd-4847-b7ad-af347e1e86fc" /&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,c3aa839b-d7dd-4847-b7ad-af347e1e86fc.aspx</comments>
      <category>IIS</category>
      <category>MSDeploy</category>
      <category>web</category>
      <category>Web Publishing Pipeline</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=7b8fedd7-a264-4823-9719-b7030ac634ed</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,7b8fedd7-a264-4823-9719-b7030ac634ed.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,7b8fedd7-a264-4823-9719-b7030ac634ed.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=7b8fedd7-a264-4823-9719-b7030ac634ed</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I blogged in December about SlowCheetah which is a Visual Studio add in which can
be used to transform app.config (<em>or any XML file for that matter</em>) in ways
similar to web.config. A few days back we released an update to this adding with a
few key items which are listed below.
</p>
        <ol>
          <li>
Support for ClickOnce</li>
          <li>
Support for Setup projects</li>
          <li>
Support for F# projects</li>
          <li>
Support for a custom diff viewer</li>
          <li>
Support for XP/Win server 2003</li>
          <li>
Better error handling, logging</li>
        </ol>
        <p>
I’ve created a set of samples for SlowCheetah which I’ll use to describe these new
features. Download links for the samples, as well as pointers to the latest versions
are at the bottom of this page.
</p>
        <h3>Support for ClickOnce
</h3>
        <p>
If you are building a windows client application (Win forms or WPF) then you can use
ClickOnce to publish this application. When you publish a project using ClickOnce
a setup.exe will be generated as well as an HTML page which can be served by a web
server to enable users to download it. When this setup.exe is generated all of the
files needed to run your application (including app.config) are placed inside of that
executable. When you have a project using SlowCheetah and you publish using a specific
configuration it will now publish the transformed app.config (as well as any other
transformed files).
</p>
        <p>
In order to demonstrate this I’ve created a sample WPF application which I will publish
with ClickOnce (<em>download link is at the bottom</em>). This project has an app.config
file as well as app.Debug.config and app.Release.config.
</p>
        <p>
Below is what the original <u><strong>app.config</strong></u>file looks like.
</p>
        <pre class="brush: xml;">&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;configuration&gt;
  &lt;appSettings&gt;
    &lt;add key="appName" value="WPF Demo-Debug-default"/&gt;
    &lt;add key="url" value="http://localhost:8080/Default/"/&gt;
    &lt;add key="email" value="demo-default@contoso.com"/&gt;
  &lt;/appSettings&gt;
  
  &lt;connectionStrings&gt;
    &lt;clear /&gt;
    &lt;add name="RecordsDb" connectionString=".\SQLExpress;Initial Catalog=RecordsDb-Default;Integrated Security=true"/&gt;  
  &lt;/connectionStrings&gt;
  
&lt;/configuration&gt;</pre>
        <p>
And here is <strong><u>app.Debug.Config</u></strong></p>
        <pre class="brush: xml;">&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"&gt;
  
  &lt;appSettings&gt;
    &lt;add key="appName" value="WPF Demo-Debug" xdt:Transform="Replace" xdt:Locator="Match(key)"/&gt;
    &lt;add key="url" value="http://localhost:8080/" xdt:Transform="Replace" xdt:Locator="Match(key)"/&gt;
    &lt;add key="email" value="debug@contoso.com" xdt:Transform="Replace" xdt:Locator="Match(key)"/&gt;
  &lt;/appSettings&gt;

  &lt;connectionStrings&gt;
    &lt;add name="RecordsDb" connectionString=".\SQLExpress;Initial Catalog=RecordsDb;Integrated Security=true"
         xdt:Transform="Replace" xdt:Locator="Match(name)"/&gt;
  &lt;/connectionStrings&gt;
  
&lt;/configuration&gt;</pre>
        <p>
ddd
</p>
        <p>
As you can see I am transforming both the appSettings as well as the connection string.
The application itself is pretty simple, it has a single page which shows the following
values.
</p>
        <ul>
          <li>
App settings</li>
          <li>
Connection strings</li>
          <li>
Content of app.config</li>
        </ul>
        <p>
When I run this application in Debug mode I will get the following result.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_2.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_thumb.png" width="999" height="705" />
          </a>
          <br />
        </p>
        <p>
In previous versions of SlowCheetah when you published your application with ClickOnce
the original version of app.config was getting published instead of the transformed
one. This was actually a bug in the .targets files for ClickOnce, but we have now
worked around it in the SlowCheetah .targets files. So let’s say that you have a ClickOnce
application and you need to publish different versions which have config changes then
you can now easily do that with SlowCheetah.
</p>
        <h3>Support for Setup projects
</h3>
        <p>
Visual Studio 2010 also has Setup projects, which can be used to generate an MSI.
When you create the MSI you can specify that it includes the outputs of a project
in the solution. We had a similar story here in which the original app.config was
being placed into the MSI instead of the transformed on in the output folder. We have
now fixed that and if you have a Setup project which reference a project with SlowCheetah
transforms then the transformed files will endup in the resulting MSI instead of the
original one.
</p>
        <h3>Support for F# projects
</h3>
        <p>
If you have F# project and tried SlowCheetah you probably noticed that the “Add Transforms”
menu item didn’t show up for those project types. They now do. 
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_9.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_thumb_3.png" width="360" height="142" />
          </a>
        </p>
        <p>
After you invoke this command you will see a transform created for each configuration
defined for the project. In other project types these transform appear as child items,
but F# projects don’t support this in the same way as C#/VB projects so they will
not be nested. So they will show up as the following. 
<br /><a href="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_6.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_thumb_2.png" width="289" height="103" /></a></p>
        <p>
I created a very simple F# application to demonstrate the behavior, below is the code.
</p>
        <pre class="brush: csharp;">// A simple application to create the config and show results in the console
let settingOne = System.Configuration.ConfigurationManager.AppSettings.["settingOne"];
let settingTwo = System.Configuration.ConfigurationManager.AppSettings.["settingTwo"];
let settingthree = System.Configuration.ConfigurationManager.AppSettings.["settingThree"];


printfn "settingOne: %s" settingOne
printfn "settingTwo: %s" settingTwo
printfn "settingThree: %s" settingthree

printfn " "
printfn "Press any key to close"
System.Console.ReadKey(true)</pre>
        <p>
As you can see this app just reads a few config values from app.config and displays
them on the console. Here is the original <strong><u>app.config </u></strong>file.
</p>
        <pre class="brush: xml;">&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;configuration&gt;
  &lt;appSettings&gt;
    &lt;add key="settingOne" value="one default value"/&gt;
    &lt;add key="settingTwo" value="two default value"/&gt;
    &lt;add key="settingThree" value="three default value"/&gt;
  &lt;/appSettings&gt;
&lt;/configuration&gt;</pre>
        <p>
Here is <strong><u>app.Debug.config</u></strong></p>
        <pre class="brush: xml;">&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"&gt;
  &lt;appSettings&gt;
    &lt;add key="settingOne" value="one Debug"
         xdt:Locator="Match(key)" xdt:Transform="Replace" /&gt;
    
    &lt;add key="settingTwo" value="two Debug"
         xdt:Locator="Match(key)" xdt:Transform="Replace" /&gt;
    
    &lt;add key="settingThree" value="three Debug"
         xdt:Locator="Match(key)" xdt:Transform="Replace" /&gt;
  &lt;/appSettings&gt;
&lt;/configuration&gt;</pre>
        <p>
There is a similar app.Release.config as well for this project.
</p>
        <p>
When I run this in <u><strong>Debug mode </strong></u>below is the result
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_11.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_thumb_4.png" width="672" height="128" />
          </a>
        </p>
        <p>
When I run this in <strong><u>Release mode</u></strong> below is the result.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_13.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_thumb_5.png" width="672" height="127" />
          </a>
        </p>
        <p>
As you can see F# project will now pickup up the transformed web.config file instead
of the original one when running.
</p>
        <h3>Support for a custom diff viewer
</h3>
        <p>
As you may know SlowCheetah has a Preview Transform functionality that allows you
to quickly see the difference between the source file and the transformed one. For
example in my Wpf.Transform project I have a app.config file and app.Debug.config
when I select one of the transforms I can see this menu item.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_15.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_thumb_6.png" width="432" height="197" />
          </a>
          <br />
When that menu item is invoked we open the Visual Studio diff viewer to show you the
difference between these two files. We have received a number of requests to support
different diff viewers and we have enabled this in the latest release.
</p>
        <p>
After installing SlowCheetah you can go to Tools-&gt;Options and then pick SlowCheetah
on the left hand side. You will see the following.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_17.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_thumb_7.png" width="648" height="379" />
          </a>
        </p>
        <p>
Here we have three settings which you can customize, they are outlined below.
</p>
        <table border="0" cellspacing="0" cellpadding="2" width="400">
          <tbody>
            <tr>
              <td valign="top" width="200">
                <p align="center">
                  <strong>
                    <u>Setting</u>
                  </strong>
                </p>
              </td>
              <td valign="top" width="200">
                <p align="center">
                  <strong>
                    <u>Description</u>
                  </strong>
                </p>
              </td>
            </tr>
            <tr>
              <td valign="top" width="200">
Preview Tool Command Line</td>
              <td valign="top" width="200">
This is a string.Format string that should be used to construct the command to be
executed. Here {0} will be replaced with the full path to the original file and {1}
with the full path to the transformed file.</td>
            </tr>
            <tr>
              <td valign="top" width="200">
Preview Tool Executable Path</td>
              <td valign="top" width="200">
This is the full path to the .exe which should be invoked during preview. 
<br />
The default value for this is “C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\diffmerge.exe”
which is the diff viewer that VS uses by default.</td>
            </tr>
            <tr>
              <td valign="top" width="200">
Run Preview Tool</td>
              <td valign="top" width="200">
If this is set to False then a diff viewer will not be shown, instead the transformed
file will just be opened.</td>
            </tr>
          </tbody>
        </table>
        <p>
If you want to use KDiff with SlowCheetah then you need it to invoke the following
command:
</p>
        <p>
          <font face="Courier New">“C:\Program Files (x86)\KDiff3\kdiff3.exe” {Path-to-original-file}
{Path-to-transformed-file}</font>
        </p>
        <p>
So in this case I just have to update the value for Preview Tool Executable Path to
be C:\Program Files (x86)\KDiff3\kdiff3.exe. After that when I perform a transform
I will see something like.
</p>
        <p>
          <a href="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_19.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_thumb_8.png" width="1351" height="525" />
          </a>
        </p>
        <h3>Support for XP/Win server 2003
</h3>
        <p>
After publishing the original version of SlowCheetah users started complaining that
it didn’t work for either Windows XP or Windows Server 2003. This is because SlowCheetah
writes file under the %LocalAppData% folder. What I didn’t realize was that XP and
Win server 2003 don’t have this environment variable defined! Because of this I had
to update the logic of where to write the files if that environment variable didn’t
exist. Now everything works seamlessly. 
<br /></p>
        <h3>Better error handling, logging
</h3>
        <p>
We had some issues in previous builds and they were difficult to diagnose because
we didn’t have any logging support. We have now updated this and we should be able
to diagnose user issues much easier.
</p>
        <p>
 
</p>
        <p>
Below are a list of resources and pointers, I hope that you guys like these updates
and please do continue giving us feedback on this!
</p>
        <h3>Resources
</h3>
        <ul>
          <li>
            <a href="http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5">SlowCheetah
download page</a>
          </li>
          <li>
            <a href="https://github.com/sayedihashimi/sayed-samples/raw/master/SlowCheetahSamples/Releases/SlowCheetahSamples-20120204.zip">Download
these samples in a .zip file</a>
          </li>
          <li>
            <a href="https://github.com/sayedihashimi/sayed-samples/tree/master/SlowCheetahSamples">My
github repo for the latest version of these samples</a>
          </li>
        </ul>
        <p>
Sayed Ibrahim Hashimi <a href="https://twitter.com/#!/sayedihashimi">@SayedIHashimi</a></p>
        <p>
          <em>Note: I work for Microsoft but this add in was not created nor is supported by
Microsoft.</em>
        </p>
        <img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=7b8fedd7-a264-4823-9719-b7030ac634ed" />
      </body>
      <title>SlowCheetah XML Updates for Setup projects, ClickOnce, F# and more</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,7b8fedd7-a264-4823-9719-b7030ac634ed.aspx</guid>
      <link>http://sedodream.com/2012/02/04/SlowCheetahXMLUpdatesForSetupProjectsClickOnceFAndMore.aspx</link>
      <pubDate>Sat, 04 Feb 2012 20:14:30 GMT</pubDate>
      <description>&lt;p&gt;
I blogged in December about SlowCheetah which is a Visual Studio add in which can
be used to transform app.config (&lt;em&gt;or any XML file for that matter&lt;/em&gt;) in ways
similar to web.config. A few days back we released an update to this adding with a
few key items which are listed below.
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Support for ClickOnce&lt;/li&gt;
&lt;li&gt;
Support for Setup projects&lt;/li&gt;
&lt;li&gt;
Support for F# projects&lt;/li&gt;
&lt;li&gt;
Support for a custom diff viewer&lt;/li&gt;
&lt;li&gt;
Support for XP/Win server 2003&lt;/li&gt;
&lt;li&gt;
Better error handling, logging&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
I’ve created a set of samples for SlowCheetah which I’ll use to describe these new
features. Download links for the samples, as well as pointers to the latest versions
are at the bottom of this page.
&lt;/p&gt;
&lt;h3&gt;Support for ClickOnce
&lt;/h3&gt;
&lt;p&gt;
If you are building a windows client application (Win forms or WPF) then you can use
ClickOnce to publish this application. When you publish a project using ClickOnce
a setup.exe will be generated as well as an HTML page which can be served by a web
server to enable users to download it. When this setup.exe is generated all of the
files needed to run your application (including app.config) are placed inside of that
executable. When you have a project using SlowCheetah and you publish using a specific
configuration it will now publish the transformed app.config (as well as any other
transformed files).
&lt;/p&gt;
&lt;p&gt;
In order to demonstrate this I’ve created a sample WPF application which I will publish
with ClickOnce (&lt;em&gt;download link is at the bottom&lt;/em&gt;). This project has an app.config
file as well as app.Debug.config and app.Release.config.
&lt;/p&gt;
&lt;p&gt;
Below is what the original &lt;u&gt;&lt;strong&gt;app.config&lt;/strong&gt; &lt;/u&gt;file looks like.
&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;configuration&amp;gt;
  &amp;lt;appSettings&amp;gt;
    &amp;lt;add key=&amp;quot;appName&amp;quot; value=&amp;quot;WPF Demo-Debug-default&amp;quot;/&amp;gt;
    &amp;lt;add key=&amp;quot;url&amp;quot; value=&amp;quot;http://localhost:8080/Default/&amp;quot;/&amp;gt;
    &amp;lt;add key=&amp;quot;email&amp;quot; value=&amp;quot;demo-default@contoso.com&amp;quot;/&amp;gt;
  &amp;lt;/appSettings&amp;gt;
  
  &amp;lt;connectionStrings&amp;gt;
    &amp;lt;clear /&amp;gt;
    &amp;lt;add name=&amp;quot;RecordsDb&amp;quot; connectionString=&amp;quot;.\SQLExpress;Initial Catalog=RecordsDb-Default;Integrated Security=true&amp;quot;/&amp;gt;  
  &amp;lt;/connectionStrings&amp;gt;
  
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;
&lt;p&gt;
And here is &lt;strong&gt;&lt;u&gt;app.Debug.Config&lt;/u&gt;&lt;/strong&gt;
&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;configuration xmlns:xdt=&amp;quot;http://schemas.microsoft.com/XML-Document-Transform&amp;quot;&amp;gt;
  
  &amp;lt;appSettings&amp;gt;
    &amp;lt;add key=&amp;quot;appName&amp;quot; value=&amp;quot;WPF Demo-Debug&amp;quot; xdt:Transform=&amp;quot;Replace&amp;quot; xdt:Locator=&amp;quot;Match(key)&amp;quot;/&amp;gt;
    &amp;lt;add key=&amp;quot;url&amp;quot; value=&amp;quot;http://localhost:8080/&amp;quot; xdt:Transform=&amp;quot;Replace&amp;quot; xdt:Locator=&amp;quot;Match(key)&amp;quot;/&amp;gt;
    &amp;lt;add key=&amp;quot;email&amp;quot; value=&amp;quot;debug@contoso.com&amp;quot; xdt:Transform=&amp;quot;Replace&amp;quot; xdt:Locator=&amp;quot;Match(key)&amp;quot;/&amp;gt;
  &amp;lt;/appSettings&amp;gt;

  &amp;lt;connectionStrings&amp;gt;
    &amp;lt;add name=&amp;quot;RecordsDb&amp;quot; connectionString=&amp;quot;.\SQLExpress;Initial Catalog=RecordsDb;Integrated Security=true&amp;quot;
         xdt:Transform=&amp;quot;Replace&amp;quot; xdt:Locator=&amp;quot;Match(name)&amp;quot;/&amp;gt;
  &amp;lt;/connectionStrings&amp;gt;
  
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;
&lt;p&gt;
ddd
&lt;/p&gt;
&lt;p&gt;
As you can see I am transforming both the appSettings as well as the connection string.
The application itself is pretty simple, it has a single page which shows the following
values.
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
App settings&lt;/li&gt;
&lt;li&gt;
Connection strings&lt;/li&gt;
&lt;li&gt;
Content of app.config&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
When I run this application in Debug mode I will get the following result.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_2.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_thumb.png" width="999" height="705" /&gt;&lt;/a&gt; 
&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
In previous versions of SlowCheetah when you published your application with ClickOnce
the original version of app.config was getting published instead of the transformed
one. This was actually a bug in the .targets files for ClickOnce, but we have now
worked around it in the SlowCheetah .targets files. So let’s say that you have a ClickOnce
application and you need to publish different versions which have config changes then
you can now easily do that with SlowCheetah.
&lt;/p&gt;
&lt;h3&gt;Support for Setup projects
&lt;/h3&gt;
&lt;p&gt;
Visual Studio 2010 also has Setup projects, which can be used to generate an MSI.
When you create the MSI you can specify that it includes the outputs of a project
in the solution. We had a similar story here in which the original app.config was
being placed into the MSI instead of the transformed on in the output folder. We have
now fixed that and if you have a Setup project which reference a project with SlowCheetah
transforms then the transformed files will endup in the resulting MSI instead of the
original one.
&lt;/p&gt;
&lt;h3&gt;Support for F# projects
&lt;/h3&gt;
&lt;p&gt;
If you have F# project and tried SlowCheetah you probably noticed that the “Add Transforms”
menu item didn’t show up for those project types. They now do. 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_9.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_thumb_3.png" width="360" height="142" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
After you invoke this command you will see a transform created for each configuration
defined for the project. In other project types these transform appear as child items,
but F# projects don’t support this in the same way as C#/VB projects so they will
not be nested. So they will show up as the following. 
&lt;br /&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_6.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_thumb_2.png" width="289" height="103" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
I created a very simple F# application to demonstrate the behavior, below is the code.
&lt;/p&gt;
&lt;pre class="brush: csharp;"&gt;// A simple application to create the config and show results in the console
let settingOne = System.Configuration.ConfigurationManager.AppSettings.[&amp;quot;settingOne&amp;quot;];
let settingTwo = System.Configuration.ConfigurationManager.AppSettings.[&amp;quot;settingTwo&amp;quot;];
let settingthree = System.Configuration.ConfigurationManager.AppSettings.[&amp;quot;settingThree&amp;quot;];


printfn &amp;quot;settingOne: %s&amp;quot; settingOne
printfn &amp;quot;settingTwo: %s&amp;quot; settingTwo
printfn &amp;quot;settingThree: %s&amp;quot; settingthree

printfn &amp;quot; &amp;quot;
printfn &amp;quot;Press any key to close&amp;quot;
System.Console.ReadKey(true)&lt;/pre&gt;
&lt;p&gt;
As you can see this app just reads a few config values from app.config and displays
them on the console. Here is the original &lt;strong&gt;&lt;u&gt;app.config &lt;/u&gt;&lt;/strong&gt;file.
&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;configuration&amp;gt;
  &amp;lt;appSettings&amp;gt;
    &amp;lt;add key=&amp;quot;settingOne&amp;quot; value=&amp;quot;one default value&amp;quot;/&amp;gt;
    &amp;lt;add key=&amp;quot;settingTwo&amp;quot; value=&amp;quot;two default value&amp;quot;/&amp;gt;
    &amp;lt;add key=&amp;quot;settingThree&amp;quot; value=&amp;quot;three default value&amp;quot;/&amp;gt;
  &amp;lt;/appSettings&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;
&lt;p&gt;
Here is &lt;strong&gt;&lt;u&gt;app.Debug.config&lt;/u&gt;&lt;/strong&gt;
&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;configuration xmlns:xdt=&amp;quot;http://schemas.microsoft.com/XML-Document-Transform&amp;quot;&amp;gt;
  &amp;lt;appSettings&amp;gt;
    &amp;lt;add key=&amp;quot;settingOne&amp;quot; value=&amp;quot;one Debug&amp;quot;
         xdt:Locator=&amp;quot;Match(key)&amp;quot; xdt:Transform=&amp;quot;Replace&amp;quot; /&amp;gt;
    
    &amp;lt;add key=&amp;quot;settingTwo&amp;quot; value=&amp;quot;two Debug&amp;quot;
         xdt:Locator=&amp;quot;Match(key)&amp;quot; xdt:Transform=&amp;quot;Replace&amp;quot; /&amp;gt;
    
    &amp;lt;add key=&amp;quot;settingThree&amp;quot; value=&amp;quot;three Debug&amp;quot;
         xdt:Locator=&amp;quot;Match(key)&amp;quot; xdt:Transform=&amp;quot;Replace&amp;quot; /&amp;gt;
  &amp;lt;/appSettings&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;
&lt;p&gt;
There is a similar app.Release.config as well for this project.
&lt;/p&gt;
&lt;p&gt;
When I run this in &lt;u&gt;&lt;strong&gt;Debug mode &lt;/strong&gt;&lt;/u&gt;below is the result
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_11.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_thumb_4.png" width="672" height="128" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
When I run this in &lt;strong&gt;&lt;u&gt;Release mode&lt;/u&gt;&lt;/strong&gt; below is the result.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_13.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_thumb_5.png" width="672" height="127" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
As you can see F# project will now pickup up the transformed web.config file instead
of the original one when running.
&lt;/p&gt;
&lt;h3&gt;Support for a custom diff viewer
&lt;/h3&gt;
&lt;p&gt;
As you may know SlowCheetah has a Preview Transform functionality that allows you
to quickly see the difference between the source file and the transformed one. For
example in my Wpf.Transform project I have a app.config file and app.Debug.config
when I select one of the transforms I can see this menu item.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_15.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_thumb_6.png" width="432" height="197" /&gt;&lt;/a&gt; 
&lt;br /&gt;
When that menu item is invoked we open the Visual Studio diff viewer to show you the
difference between these two files. We have received a number of requests to support
different diff viewers and we have enabled this in the latest release.
&lt;/p&gt;
&lt;p&gt;
After installing SlowCheetah you can go to Tools-&amp;gt;Options and then pick SlowCheetah
on the left hand side. You will see the following.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_17.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_thumb_7.png" width="648" height="379" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Here we have three settings which you can customize, they are outlined below.
&lt;/p&gt;
&lt;table border="0" cellspacing="0" cellpadding="2" width="400"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="200"&gt;
&lt;p align="center"&gt;
&lt;strong&gt;&lt;u&gt;Setting&lt;/u&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top" width="200"&gt;
&lt;p align="center"&gt;
&lt;strong&gt;&lt;u&gt;Description&lt;/u&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="200"&gt;
Preview Tool Command Line&lt;/td&gt;
&lt;td valign="top" width="200"&gt;
This is a string.Format string that should be used to construct the command to be
executed. Here {0} will be replaced with the full path to the original file and {1}
with the full path to the transformed file.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="200"&gt;
Preview Tool Executable Path&lt;/td&gt;
&lt;td valign="top" width="200"&gt;
This is the full path to the .exe which should be invoked during preview. 
&lt;br /&gt;
The default value for this is “C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\diffmerge.exe”
which is the diff viewer that VS uses by default.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="200"&gt;
Run Preview Tool&lt;/td&gt;
&lt;td valign="top" width="200"&gt;
If this is set to False then a diff viewer will not be shown, instead the transformed
file will just be opened.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;
If you want to use KDiff with SlowCheetah then you need it to invoke the following
command:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;“C:\Program Files (x86)\KDiff3\kdiff3.exe” {Path-to-original-file}
{Path-to-transformed-file}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
So in this case I just have to update the value for Preview Tool Executable Path to
be C:\Program Files (x86)\KDiff3\kdiff3.exe. After that when I perform a transform
I will see something like.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_19.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://sedodream.com/content/binary/Windows-Live-Writer/SlowCheetah-XML-Updates-for_9D84/image_thumb_8.png" width="1351" height="525" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;h3&gt;Support for XP/Win server 2003
&lt;/h3&gt;
&lt;p&gt;
After publishing the original version of SlowCheetah users started complaining that
it didn’t work for either Windows XP or Windows Server 2003. This is because SlowCheetah
writes file under the %LocalAppData% folder. What I didn’t realize was that XP and
Win server 2003 don’t have this environment variable defined! Because of this I had
to update the logic of where to write the files if that environment variable didn’t
exist. Now everything works seamlessly. 
&lt;br /&gt;
&lt;/p&gt;
&lt;h3&gt;Better error handling, logging
&lt;/h3&gt;
&lt;p&gt;
We had some issues in previous builds and they were difficult to diagnose because
we didn’t have any logging support. We have now updated this and we should be able
to diagnose user issues much easier.
&lt;/p&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
Below are a list of resources and pointers, I hope that you guys like these updates
and please do continue giving us feedback on this!
&lt;/p&gt;
&lt;h3&gt;Resources
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5"&gt;SlowCheetah
download page&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/sayedihashimi/sayed-samples/raw/master/SlowCheetahSamples/Releases/SlowCheetahSamples-20120204.zip"&gt;Download
these samples in a .zip file&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/sayedihashimi/sayed-samples/tree/master/SlowCheetahSamples"&gt;My
github repo for the latest version of these samples&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi &lt;a href="https://twitter.com/#!/sayedihashimi"&gt;@SayedIHashimi&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Note: I work for Microsoft but this add in was not created nor is supported by
Microsoft.&lt;/em&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://sedodream.com/aggbug.ashx?id=7b8fedd7-a264-4823-9719-b7030ac634ed" /&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,7b8fedd7-a264-4823-9719-b7030ac634ed.aspx</comments>
    </item>
  </channel>
</rss>
