<?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>Jay Harris is Cpt. LoadTest - NAnt</title>
    <link>http://www.cptloadtest.com/</link>
    <description>a .net developers blog on improving user experience of humans and coders</description>
    <language>en-us</language>
    <copyright>Jason Harris</copyright>
    <lastBuildDate>Sat, 22 Sep 2007 02:00:26 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.12105.0</generator>
    <managingEditor>jharris@harrisdesigns.com</managingEditor>
    <webMaster>jharris@harrisdesigns.com</webMaster>
    <item>
      <trackback:ping>http://www.cptloadtest.com/Trackback.aspx?guid=a4b7be94-d409-4e74-abfa-a39cc4cdff77</trackback:ping>
      <pingback:server>http://www.cptloadtest.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.cptloadtest.com/PermaLink,guid,a4b7be94-d409-4e74-abfa-a39cc4cdff77.aspx</pingback:target>
      <dc:creator>Jay Harris</dc:creator>
      <wfw:comment>http://www.cptloadtest.com/CommentView,guid,a4b7be94-d409-4e74-abfa-a39cc4cdff77.aspx</wfw:comment>
      <wfw:commentRss>http://www.cptloadtest.com/SyndicationService.asmx/GetEntryCommentsRss?guid=a4b7be94-d409-4e74-abfa-a39cc4cdff77</wfw:commentRss>
      <slash:comments>5</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Scott Hanselman posted an entry yesterday about <a href="http://www.hanselman.com/blog/ManagingMultipleConfigurationFileEnvironmentsWithPreBuildEvents.aspx">Managing
Multiple Configuration File Environments with Pre-build Events</a>. His design uses
pre-build events in Visual Studio to copy specific configuration files to the default
file name, such as having "web.config.debug" and a "web.config.release" configuration
files and the pre-build copying the appropriate file to "web.config" based on which
build configuration you are in. This is a great idea, but large web.config files can
get tedious to maintain, and there is a lot of repeated code. Even using include files
as Scott suggests would help, but major blocks, such as Application Settings, may
have to be repeated even though only the values change. This exposes human error,
since an app setting may be forgotten or misspelled in one of your web.config versions.
</p>
        <p>
At Latitude, we manage this problem through NAnt. One of our former developers, Erik
Nelsestuen–brilliant guy–authored the original version of what we call "ConfigMerge".
Essentially, our projects have no web.config under source control. Instead, we have
a web.format.config. The format config is nearly identical to the web.config, except
all of the application settings and connection strings have been replaced with NAnt
property strings. Rather than have a seperate web.config for each environment and
build configuration, we simply have NAnt property files. Our build events (as well
as our automated build scripts) pass the location of the format file and the location
of the property file and the output is a valid web.config, with the NAnt property
strings replaced with their values from the environment property file.
</p>
        <p>
It's simple. It only takes one NAnt COPY command.
</p>
        <p>
          <strong>default.build</strong>
        </p>
        <pre name="code" class="xml">&lt;project default="configMerge"&gt;
  &lt;property name="destinationfile"
    value="web.config" overwrite="false" /&gt;
  &lt;property name="propertyfile"
    value="invalid.file" overwrite="false" /&gt;
  &lt;property name="sourcefile"
    value="web.format.config" overwrite="false" /&gt;
 
  &lt;include buildfile="${propertyfile}" failonerror="false"
    unless="${string::contains(propertyfile, 'invalid.file')}" /&gt;
 
  &lt;target name="configMerge"&gt;
    &lt;copy file="${sourcefile}"
        tofile="${destinationfile}" overwrite="true"&gt;
      &lt;filterchain&gt;
        &lt;expandproperties /&gt;
      &lt;/filterchain&gt;
    &lt;/copy&gt;
  &lt;/target&gt;
&lt;/project&gt;</pre>
        <p>
For an example, lets start with a partial web.config, just so you get the idea. I've
stripped out most of the goo from a basic web.config, and am left with this:
</p>
        <p>
          <strong>web.confg</strong>
        </p>
        <pre name="code" class="xml:nocontrols">&lt;configuration&gt;
  &lt;system.web&gt;
    &lt;compilation defaultLanguage="c#" debug="true" /&gt;
    &lt;customErrors mode="RemoteOnly" /&gt; 
  &lt;/system.web&gt;
&lt;/configuration&gt;</pre>
        <p>
In a debug environment, we may want to enable debugging and turn off custom errors,
but in release mode disable debugging and turn on RemoteOnly custom errors. The first
thing we will need to do is create a format file, and then convert the values that
we want to make dynamic into NAnt property strings.
</p>
        <p>
          <strong>web.format.config</strong>
        </p>
        <pre name="code" class="xml:nocontrols">&lt;configuration&gt;
  &lt;system.web&gt;
    &lt;compilation defaultLanguage="c#" debug="${debugValue}" /&gt;
    &lt;customErrors mode="${customErrorsValue}" /&gt; 
  &lt;/system.web&gt;
&lt;/configuration&gt;</pre>
        <p>
Next, we need to make NAnt property files, and add in values for each NAnt property
that we've created. These property files will include the values to be injected into
the web.config output. For the sake of simplicity, I always give my property files
a '.property' file extension, but nant will accept any file name; you can use '.foo'
if you like.<!--]--></p>
        <p>
          <strong>debugBuild.property</strong>
        </p>
        <pre name="code" class="xml:nocontrols">&lt;project&gt;
   &lt;property name="debugValue" value="true" /&gt;
   &lt;property name="configMergeValue" value="Off" /&gt;
&lt;/project&gt;</pre>
        <p>
          <strong>releaseBuild.property</strong>
        </p>
        <pre name="code" class="xml:nocontrols">&lt;project&gt;
   &lt;property name="debugValue" value="false" /&gt;
   &lt;property name="configMergeValue" value="RemoteOnly" /&gt;
&lt;/project&gt;</pre>
        <p>
Finally, we just execute the NAnt script, passing in the appropriate source, destination
and property file locations to produce our environment-specific web.config.
</p>
        <p>
          <strong>nant configMerge -D:sourcefile=web.format.config -D:propertyfile=debugBuild.property
-D:destinationfile=web.config</strong>
          <br />
          <em>web.config output</em>
        </p>
        <pre name="code" class="xml:nocontrols">&lt;configuration&gt;
  &lt;system.web&gt;
    &lt;compilation defaultLanguage="c#" debug="true" /&gt;
    &lt;customErrors mode="Off" /&gt; 
  &lt;/system.web&gt;
&lt;/configuration&gt;</pre>
        <p>
And that's all there is to it. This is extendable further using the powers of NAnt.
Using NAnt includes, you can put all of your base or default values in one property
file that's referenced in your debugBuild.property or releaseBuild.property, further
minimizing code. You can use Scott's pre-build event idea to have each build configuration
have its own NAnt command to make mode-specific configuration files.
</p>
        <p>
Feel free to use the above NAnt script however you like; but, as always YMMV. Use
it at your own risk.
</p>
        <p>
Enjoy.
</p>
        <img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=a4b7be94-d409-4e74-abfa-a39cc4cdff77" />
      </body>
      <title>Managing Multiple Environment Configurations through NAnt</title>
      <guid isPermaLink="false">http://www.cptloadtest.com/PermaLink,guid,a4b7be94-d409-4e74-abfa-a39cc4cdff77.aspx</guid>
      <link>http://www.cptloadtest.com/2007/09/22/Managing-Multiple-Environment-Configurations-Through-NAnt.aspx</link>
      <pubDate>Sat, 22 Sep 2007 02:00:26 GMT</pubDate>
      <description>&lt;p&gt;
Scott Hanselman posted an entry yesterday about &lt;a href="http://www.hanselman.com/blog/ManagingMultipleConfigurationFileEnvironmentsWithPreBuildEvents.aspx"&gt;Managing
Multiple Configuration File Environments with Pre-build Events&lt;/a&gt;. His design uses
pre-build events in Visual Studio to copy specific configuration files to the default
file name, such as having "web.config.debug" and a "web.config.release" configuration
files and the pre-build copying the appropriate file to "web.config" based on which
build configuration you are in. This is a great idea, but large web.config files can
get tedious to maintain, and there is a lot of repeated code. Even using include files
as Scott suggests would help, but major blocks, such as Application Settings, may
have to be repeated even though only the values change. This exposes human error,
since an app setting may be forgotten or misspelled in one of your web.config versions.
&lt;/p&gt;
&lt;p&gt;
At Latitude, we manage this problem through NAnt. One of our former developers, Erik
Nelsestuen–brilliant guy–authored the original version of what we call "ConfigMerge".
Essentially, our projects have no web.config under source control. Instead, we have
a web.format.config. The format config is nearly identical to the web.config, except
all of the application settings and connection strings have been replaced with NAnt
property strings. Rather than have a seperate web.config for each environment and
build configuration, we simply have NAnt property files. Our build events (as well
as our automated build scripts) pass the location of the format file and the location
of the property file and the output is a valid web.config, with the NAnt property
strings replaced with their values from the environment property file.
&lt;/p&gt;
&lt;p&gt;
It's simple. It only takes one NAnt COPY command.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;default.build&lt;/strong&gt;
&lt;/p&gt;
&lt;pre name="code" class="xml"&gt;&amp;lt;project default="configMerge"&amp;gt;
  &amp;lt;property name="destinationfile"
    value="web.config" overwrite="false" /&amp;gt;
  &amp;lt;property name="propertyfile"
    value="invalid.file" overwrite="false" /&amp;gt;
  &amp;lt;property name="sourcefile"
    value="web.format.config" overwrite="false" /&amp;gt;
 
  &amp;lt;include buildfile="${propertyfile}" failonerror="false"
    unless="${string::contains(propertyfile, 'invalid.file')}" /&amp;gt;
 
  &amp;lt;target name="configMerge"&amp;gt;
    &amp;lt;copy file="${sourcefile}"
        tofile="${destinationfile}" overwrite="true"&amp;gt;
      &amp;lt;filterchain&amp;gt;
        &amp;lt;expandproperties /&amp;gt;
      &amp;lt;/filterchain&amp;gt;
    &amp;lt;/copy&amp;gt;
  &amp;lt;/target&amp;gt;
&amp;lt;/project&amp;gt;&lt;/pre&gt;
&lt;p&gt;
For an example, lets start with a partial web.config, just so you get the idea. I've
stripped out most of the goo from a basic web.config, and am left with this:
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;web.confg&lt;/strong&gt;
&lt;/p&gt;
&lt;pre name="code" class="xml:nocontrols"&gt;&amp;lt;configuration&amp;gt;
  &amp;lt;system.web&amp;gt;
    &amp;lt;compilation defaultLanguage="c#" debug="true" /&amp;gt;
    &amp;lt;customErrors mode="RemoteOnly" /&amp;gt; 
  &amp;lt;/system.web&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;
&lt;p&gt;
In a debug environment, we may want to enable debugging and turn off custom errors,
but in release mode disable debugging and turn on RemoteOnly custom errors. The first
thing we will need to do is create a format file, and then convert the values that
we want to make dynamic into NAnt property strings.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;web.format.config&lt;/strong&gt;
&lt;/p&gt;
&lt;pre name="code" class="xml:nocontrols"&gt;&amp;lt;configuration&amp;gt;
  &amp;lt;system.web&amp;gt;
    &amp;lt;compilation defaultLanguage="c#" debug="${debugValue}" /&amp;gt;
    &amp;lt;customErrors mode="${customErrorsValue}" /&amp;gt; 
  &amp;lt;/system.web&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;
&lt;p&gt;
Next, we need to make NAnt property files, and add in values for each NAnt property
that we've created. These property files will include the values to be injected into
the web.config output. For the sake of simplicity, I always give my property files
a '.property' file extension, but nant will accept any file name; you can use '.foo'
if you like.&lt;!--]--&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;debugBuild.property&lt;/strong&gt;
&lt;/p&gt;
&lt;pre name="code" class="xml:nocontrols"&gt;&amp;lt;project&amp;gt;
   &amp;lt;property name="debugValue" value="true" /&amp;gt;
   &amp;lt;property name="configMergeValue" value="Off" /&amp;gt;
&amp;lt;/project&amp;gt;&lt;/pre&gt;
&lt;p&gt;
&lt;strong&gt;releaseBuild.property&lt;/strong&gt;
&lt;/p&gt;
&lt;pre name="code" class="xml:nocontrols"&gt;&amp;lt;project&amp;gt;
   &amp;lt;property name="debugValue" value="false" /&amp;gt;
   &amp;lt;property name="configMergeValue" value="RemoteOnly" /&amp;gt;
&amp;lt;/project&amp;gt;&lt;/pre&gt;
&lt;p&gt;
Finally, we just execute the NAnt script, passing in the appropriate source, destination
and property file locations to produce our environment-specific web.config.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;nant configMerge -D:sourcefile=web.format.config -D:propertyfile=debugBuild.property
-D:destinationfile=web.config&lt;/strong&gt;
&lt;br&gt;
&lt;em&gt;web.config output&lt;/em&gt;
&lt;/p&gt;
&lt;pre name="code" class="xml:nocontrols"&gt;&amp;lt;configuration&amp;gt;
  &amp;lt;system.web&amp;gt;
    &amp;lt;compilation defaultLanguage="c#" debug="true" /&amp;gt;
    &amp;lt;customErrors mode="Off" /&amp;gt; 
  &amp;lt;/system.web&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;
&lt;p&gt;
And that's all there is to it. This is extendable further using the powers of NAnt.
Using NAnt includes, you can put all of your base or default values in one property
file that's referenced in your debugBuild.property or releaseBuild.property, further
minimizing code. You can use Scott's pre-build event idea to have each build configuration
have its own NAnt command to make mode-specific configuration files.
&lt;/p&gt;
&lt;p&gt;
Feel free to use the above NAnt script however you like; but, as always YMMV. Use
it at your own risk.
&lt;/p&gt;
&lt;p&gt;
Enjoy.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=a4b7be94-d409-4e74-abfa-a39cc4cdff77" /&gt;</description>
      <comments>http://www.cptloadtest.com/CommentView,guid,a4b7be94-d409-4e74-abfa-a39cc4cdff77.aspx</comments>
      <category>NAnt</category>
      <category>Task Automation</category>
      <category>Tools</category>
    </item>
    <item>
      <trackback:ping>http://www.cptloadtest.com/Trackback.aspx?guid=437e304b-0300-43eb-9903-e0728979a949</trackback:ping>
      <pingback:server>http://www.cptloadtest.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.cptloadtest.com/PermaLink,guid,437e304b-0300-43eb-9903-e0728979a949.aspx</pingback:target>
      <dc:creator>Jay Harris</dc:creator>
      <wfw:comment>http://www.cptloadtest.com/CommentView,guid,437e304b-0300-43eb-9903-e0728979a949.aspx</wfw:comment>
      <wfw:commentRss>http://www.cptloadtest.com/SyndicationService.asmx/GetEntryCommentsRss?guid=437e304b-0300-43eb-9903-e0728979a949</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Both NAnt and NAntContrib released version 0.85 on Sunday. The changes to NAnt from
0.85 rc4 only include a few bug fixes. NAntContrib has added the ability to specify
the encoding on SQL files. All-in-all, not much has changed since 0.85 rc4, but that
is a good thing, since it indicates the version is finally ready for release. The
first release candidate was made available nearly two years ago.
</p>
        <p>
Despite the minimal changes in the final package, consider upgrading just to get rid
of the ‘release candidate’ tag.
</p>
        <p>
NAnt v0.85 [ <a href="http://nant.sourceforge.net/">homepage</a> | <a href="http://sourceforge.net/project/showfiles.php?group_id=31650">download</a> | <a href="http://nant.sourceforge.net/release/0.85/releasenotes.html">release
notes</a> ]<br />
NAntContrib v0.85 [ <a href="http://nantcontrib.sourceforge.net/">homepage</a> | <a href="http://sourceforge.net/project/showfiles.php?group_id=54790">download</a> | <a href="http://nantcontrib.sourceforge.net/release/0.85/releasenotes.html">release
notes</a> ]
</p>
        <img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=437e304b-0300-43eb-9903-e0728979a949" />
      </body>
      <title>NAnt &amp; NantContrib 0.85 Released</title>
      <guid isPermaLink="false">http://www.cptloadtest.com/PermaLink,guid,437e304b-0300-43eb-9903-e0728979a949.aspx</guid>
      <link>http://www.cptloadtest.com/2006/10/18/NAnt-NantContrib-085-Released.aspx</link>
      <pubDate>Wed, 18 Oct 2006 02:42:02 GMT</pubDate>
      <description>&lt;p&gt;
Both NAnt and NAntContrib released version 0.85 on Sunday. The changes to NAnt from
0.85 rc4 only include a few bug fixes. NAntContrib has added the ability to specify
the encoding on SQL files. All-in-all, not much has changed since 0.85 rc4, but that
is a good thing, since it indicates the version is finally ready for release. The
first release candidate was made available nearly two years ago.
&lt;/p&gt;
&lt;p&gt;
Despite the minimal changes in the final package, consider upgrading just to get rid
of the ‘release candidate’ tag.
&lt;/p&gt;
&lt;p&gt;
NAnt v0.85 [ &lt;a href="http://nant.sourceforge.net/"&gt;homepage&lt;/a&gt; | &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=31650"&gt;download&lt;/a&gt; | &lt;a href="http://nant.sourceforge.net/release/0.85/releasenotes.html"&gt;release
notes&lt;/a&gt; ]&lt;br&gt;
NAntContrib v0.85 [ &lt;a href="http://nantcontrib.sourceforge.net/"&gt;homepage&lt;/a&gt; | &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=54790"&gt;download&lt;/a&gt; | &lt;a href="http://nantcontrib.sourceforge.net/release/0.85/releasenotes.html"&gt;release
notes&lt;/a&gt; ]
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=437e304b-0300-43eb-9903-e0728979a949" /&gt;</description>
      <comments>http://www.cptloadtest.com/CommentView,guid,437e304b-0300-43eb-9903-e0728979a949.aspx</comments>
      <category>NAnt</category>
      <category>Task Automation</category>
      <category>Tools</category>
    </item>
    <item>
      <trackback:ping>http://www.cptloadtest.com/Trackback.aspx?guid=ccfd87ed-d405-4ede-9ae3-999e231d2df9</trackback:ping>
      <pingback:server>http://www.cptloadtest.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.cptloadtest.com/PermaLink,guid,ccfd87ed-d405-4ede-9ae3-999e231d2df9.aspx</pingback:target>
      <dc:creator>Jay Harris</dc:creator>
      <wfw:comment>http://www.cptloadtest.com/CommentView,guid,ccfd87ed-d405-4ede-9ae3-999e231d2df9.aspx</wfw:comment>
      <wfw:commentRss>http://www.cptloadtest.com/SyndicationService.asmx/GetEntryCommentsRss?guid=ccfd87ed-d405-4ede-9ae3-999e231d2df9</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
NAnt hates .Net’s resource files, or .resx. Don’t get me wrong–it handles them just
fine–but large quantities of resx will really bog it down.
</p>
        <p>
Visual Studio loves resx. The IDE will automatically create a resource file for you
when you open pages and controls in the ‘designer’ view. Back when we still used Visual
SourceSafe as our SCM, Visual Studio happily checked the file in and forgot about
it. Now, our 500+ page application has 500+ resource files. Most of these 500+ resource
files contain zero resources, making them useless, pointless, and a detriment to the
build.
</p>
        <p>
This morning I went through the build log, noting every resx that contained zero resources,
and deleted all of these useless files.
</p>
        <p>
The compile time dropped by 5 minutes.
</p>
        <p>
          <em>Moral of the story:</em> Be weary of Visual Studio. With regards to resx, VS is
a malware program that’s just filling your hard drive with junk. If you use resx,
great, but if you don’t, delete them all. NAnt will love you for it.
</p>
        <img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=ccfd87ed-d405-4ede-9ae3-999e231d2df9" />
      </body>
      <title>NAnt slowdowns: Visual Studio, the .resx machine</title>
      <guid isPermaLink="false">http://www.cptloadtest.com/PermaLink,guid,ccfd87ed-d405-4ede-9ae3-999e231d2df9.aspx</guid>
      <link>http://www.cptloadtest.com/2006/02/15/NAnt-Slowdowns-Visual-Studio-The-Resx-Machine.aspx</link>
      <pubDate>Wed, 15 Feb 2006 16:31:31 GMT</pubDate>
      <description>&lt;p&gt;
NAnt hates .Net’s resource files, or .resx. Don’t get me wrong–it handles them just
fine–but large quantities of resx will really bog it down.
&lt;/p&gt;
&lt;p&gt;
Visual Studio loves resx. The IDE will automatically create a resource file for you
when you open pages and controls in the ‘designer’ view. Back when we still used Visual
SourceSafe as our SCM, Visual Studio happily checked the file in and forgot about
it. Now, our 500+ page application has 500+ resource files. Most of these 500+ resource
files contain zero resources, making them useless, pointless, and a detriment to the
build.
&lt;/p&gt;
&lt;p&gt;
This morning I went through the build log, noting every resx that contained zero resources,
and deleted all of these useless files.
&lt;/p&gt;
&lt;p&gt;
The compile time dropped by 5 minutes.
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Moral of the story:&lt;/em&gt; Be weary of Visual Studio. With regards to resx, VS is
a malware program that’s just filling your hard drive with junk. If you use resx,
great, but if you don’t, delete them all. NAnt will love you for it.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=ccfd87ed-d405-4ede-9ae3-999e231d2df9" /&gt;</description>
      <comments>http://www.cptloadtest.com/CommentView,guid,ccfd87ed-d405-4ede-9ae3-999e231d2df9.aspx</comments>
      <category>ASP.Net</category>
      <category>Continuous Integration</category>
      <category>NAnt</category>
      <category>Programming</category>
      <category>Task Automation</category>
      <category>Visual Studio</category>
    </item>
    <item>
      <trackback:ping>http://www.cptloadtest.com/Trackback.aspx?guid=8c1f277e-a561-4bca-99e7-facfa9e2583c</trackback:ping>
      <pingback:server>http://www.cptloadtest.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.cptloadtest.com/PermaLink,guid,8c1f277e-a561-4bca-99e7-facfa9e2583c.aspx</pingback:target>
      <dc:creator>Jay Harris</dc:creator>
      <wfw:comment>http://www.cptloadtest.com/CommentView,guid,8c1f277e-a561-4bca-99e7-facfa9e2583c.aspx</wfw:comment>
      <wfw:commentRss>http://www.cptloadtest.com/SyndicationService.asmx/GetEntryCommentsRss?guid=8c1f277e-a561-4bca-99e7-facfa9e2583c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I know. I haven’t posted in a while. But I’ve been crazy busy. Twelve hour days are
my norm, right now. But enough complaining; let’s get to the good stuff.
</p>
        <p>
By now you know my love for PsExec. I discovered it when trying to find a way to add
assemblies to a remote GAC [<a href="http://www.cptloadtest.com/?cat=8">post</a>].
I’ve found more love for it. Now, I can remotely execute my performance tests!
</p>
        <h3>Execute LoadRunner test using NAnt via LoadRunner:
</h3>
        <pre name="code" class="xml">&lt;exec basedir="${P1}"
  program="psexec"
  failonerror="false"
  commandline='\${P2} /u ${P3} /p ${P4} /i /w "${P5}" cmd /c wlrun -Run
    -InvokeAnalysis -TestPath "${P6}" -ResultLocation "${P7}"
    -ResultCleanName "${P8}"' /&gt;
</pre>
        <p>
(I’ve created generic parameter names so that you can read it a little better.)<br /><strong>P1</strong>: Local directory for PsExec<br /><strong>P2</strong>: LoadRunner Controller Server name<br /><strong>P3</strong>: LoadRunner Controller Server user username. I use an Admin-level
ID here, since this ID also needs rights to capture Windows PerfMon metrics on my
app servers.<br /><strong>P4</strong>: LoadRunner Controller Server user password<br /><strong>P5</strong>: Working directory on P2 for 'wlrun.exe', such as C:\Program Files\Mercury\Mercury
LoadRunner\bin<br /><strong>P6</strong>: Path on P2 to the LoadRunner scenario file<br /><strong>P7</strong>: Directory on P2 that contains all results from every test<br /><strong>P8</strong>: Result Set name for this test run
</p>
        <p>
'-InvokeAnalysis' will automatically execute LoadRunner analysis at test completion.
If you properly configure your Analysis default template, Analysis will automatically
generate the result set you want, save the Analysis session information, and create
a HTML report of the results. Now, put IIS on your Controller machine, and VDir to
the main results directory in P7, and you will have access to the HTML report within
minutes after your test completes.
</p>
        <h4>Other ideas:
</h4>
        <ul>
          <li>
You can also hook it up to CruiseControl and have your CC.Net report include a link
to the LR report.</li>
          <li>
Create a nightly build in CC.Net that will compile your code, deploy it to your performance
testing environment, and execute the performance test. When you get to work in the
morning, you have a link to your full performance test report waiting in your inbox.</li>
        </ul>
        <p>
The catch for all of this: you need a session logged in to the LoadRunner controller
box at all times. The '/i' in the PsExec command means that it interacts with the
desktop.
</p>
        <h4>
          <em>Sidenote</em>
        </h4>
        <p>
PsExec is my favorite tool right now. I can do so many cool things. I admit, as a
domain administrator, I also get a little malicious, sometimes. The other day I used
PsExec to start up solitaire on a co-workers box, then razzed him for playing games
on the clock.
</p>
        <img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=8c1f277e-a561-4bca-99e7-facfa9e2583c" />
      </body>
      <title>Automate LoadRunner through NAnt</title>
      <guid isPermaLink="false">http://www.cptloadtest.com/PermaLink,guid,8c1f277e-a561-4bca-99e7-facfa9e2583c.aspx</guid>
      <link>http://www.cptloadtest.com/2005/10/14/Automate-LoadRunner-Through-NAnt.aspx</link>
      <pubDate>Fri, 14 Oct 2005 15:35:40 GMT</pubDate>
      <description>&lt;p&gt;
I know. I haven’t posted in a while. But I’ve been crazy busy. Twelve hour days are
my norm, right now. But enough complaining; let’s get to the good stuff.
&lt;/p&gt;
&lt;p&gt;
By now you know my love for PsExec. I discovered it when trying to find a way to add
assemblies to a remote GAC [&lt;a href="http://www.cptloadtest.com/?cat=8"&gt;post&lt;/a&gt;].
I’ve found more love for it. Now, I can remotely execute my performance tests!
&lt;/p&gt;
&lt;h3&gt;Execute LoadRunner test using NAnt via LoadRunner:
&lt;/h3&gt;
&lt;pre name="code" class="xml"&gt;&amp;lt;exec basedir="${P1}"
  program="psexec"
  failonerror="false"
  commandline='\${P2} /u ${P3} /p ${P4} /i /w "${P5}" cmd /c wlrun -Run
    -InvokeAnalysis -TestPath "${P6}" -ResultLocation "${P7}"
    -ResultCleanName "${P8}"' /&amp;gt;
&lt;/pre&gt;
&lt;p&gt;
(I’ve created generic parameter names so that you can read it a little better.)&lt;br&gt;
&lt;strong&gt;P1&lt;/strong&gt;: Local directory for PsExec&lt;br&gt;
&lt;strong&gt;P2&lt;/strong&gt;: LoadRunner Controller Server name&lt;br&gt;
&lt;strong&gt;P3&lt;/strong&gt;: LoadRunner Controller Server user username. I use an Admin-level
ID here, since this ID also needs rights to capture Windows PerfMon metrics on my
app servers.&lt;br&gt;
&lt;strong&gt;P4&lt;/strong&gt;: LoadRunner Controller Server user password&lt;br&gt;
&lt;strong&gt;P5&lt;/strong&gt;: Working directory on P2 for 'wlrun.exe', such as C:\Program Files\Mercury\Mercury
LoadRunner\bin&lt;br&gt;
&lt;strong&gt;P6&lt;/strong&gt;: Path on P2 to the LoadRunner scenario file&lt;br&gt;
&lt;strong&gt;P7&lt;/strong&gt;: Directory on P2 that contains all results from every test&lt;br&gt;
&lt;strong&gt;P8&lt;/strong&gt;: Result Set name for this test run
&lt;/p&gt;
&lt;p&gt;
'-InvokeAnalysis' will automatically execute LoadRunner analysis at test completion.
If you properly configure your Analysis default template, Analysis will automatically
generate the result set you want, save the Analysis session information, and create
a HTML report of the results. Now, put IIS on your Controller machine, and VDir to
the main results directory in P7, and you will have access to the HTML report within
minutes after your test completes.
&lt;/p&gt;
&lt;h4&gt;Other ideas:
&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
You can also hook it up to CruiseControl and have your CC.Net report include a link
to the LR report.&lt;/li&gt;
&lt;li&gt;
Create a nightly build in CC.Net that will compile your code, deploy it to your performance
testing environment, and execute the performance test. When you get to work in the
morning, you have a link to your full performance test report waiting in your inbox.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
The catch for all of this: you need a session logged in to the LoadRunner controller
box at all times. The '/i' in the PsExec command means that it interacts with the
desktop.
&lt;/p&gt;
&lt;h4&gt;&lt;em&gt;Sidenote&lt;/em&gt;
&lt;/h4&gt;
&lt;p&gt;
PsExec is my favorite tool right now. I can do so many cool things. I admit, as a
domain administrator, I also get a little malicious, sometimes. The other day I used
PsExec to start up solitaire on a co-workers box, then razzed him for playing games
on the clock.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=8c1f277e-a561-4bca-99e7-facfa9e2583c" /&gt;</description>
      <comments>http://www.cptloadtest.com/CommentView,guid,8c1f277e-a561-4bca-99e7-facfa9e2583c.aspx</comments>
      <category>Continuous Integration</category>
      <category>NAnt</category>
      <category>Performance</category>
      <category>Task Automation</category>
      <category>Testing</category>
      <category>LoadRunner</category>
    </item>
    <item>
      <trackback:ping>http://www.cptloadtest.com/Trackback.aspx?guid=de45fc73-2205-457c-ac02-5c83a8cd4ad9</trackback:ping>
      <pingback:server>http://www.cptloadtest.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.cptloadtest.com/PermaLink,guid,de45fc73-2205-457c-ac02-5c83a8cd4ad9.aspx</pingback:target>
      <dc:creator>Jay Harris</dc:creator>
      <wfw:comment>http://www.cptloadtest.com/CommentView,guid,de45fc73-2205-457c-ac02-5c83a8cd4ad9.aspx</wfw:comment>
      <wfw:commentRss>http://www.cptloadtest.com/SyndicationService.asmx/GetEntryCommentsRss?guid=de45fc73-2205-457c-ac02-5c83a8cd4ad9</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
With our new <a href="http://www.cptloadtest.com/2005/08/23/DatabaseRestoreThroughNAnt.aspx">nightly
database restore</a> we now have the desire to automatically run all of the change
scripts associated with a project. We’ve found a way; I created a NAnt script that
will parse the Visual Studio Database Project (or "DBP") and execute all of the change
scripts in it. Here’s how we got there.
</p>
        <hr />
        <h3>Problem 1: Visual Studio Command Files are worthless
</h3>
        <p>
Our first idea was to have everyone update a command file in the DBP, and have NAnt
run it every night. Visual Studio command files are great and all, but we have discovered
a problem with them: they do not keep the files in order. We have named all of our
folders (01 DDL, 02 DML, etc) and our change scripts (0001 Create MyTable.sql, 0002
AddInfoColumn to MyTable.sql) accordingly so that they <em>should</em> run in order.
We have found that the command file feature of VS.Net 2003 does not keep them in order
but rather seems to sort them first by extension, then by order, or some similar oddness.
Obviously, if I try to at InfoColumn to MyTable before MyTable exists, I’m going to
have a problem. So, the command file idea was axed.
</p>
        <h3>Problem 2: Visual SourceSafe contents can’t be trusted
</h3>
        <p>
Our second idea was to VSSGET the DBP directory in VSS and execute every script in
it. However, the VSS store cannot be trusted. If a developer creates a script in VS.Net
called ‘0001 Crate MyTable.sql’ and checks it in to the project, then proceeds to
correct the spelling error in VS.Net to ‘0001 Create MyTable.sql’, VS does not rename
the old file in VSS. Instead, it removes the old file from the project, renames it
locally, then adds the new name to the project and to VSS. It also never deletes the
old file name from the VSS store. Now, both files (’0001 Crate MyTable.sql’ and ‘0001
Create MyTable.sql’) exist in VSS. Performing a VSSGET and executing all scripts will
run both scripts, which could lead to more troubles.
</p>
        <hr />
        <p>
So, we can’t use a command file, because it won’t maintain the order. We can’t trust
VSS, since it can have obsolete files. We can only trust the project, but how do we
get a list of files, ourselves?
</p>
        <p>
Fortunately, DBP files are just text in a weird XML-wannabe format. The NAnt script
will open the file and run through it looking for every ‘SCRIPT’ entry in the file.
If it finds a ‘BEGIN something’ entry, it assumes that ’something’ is a folder name,
and appends it to the working path until it finds ‘END’, at which time it returns
to the parent directory.
</p>
        <p>
It’s not perfect. It still runs in to some problems, but here it is in v0.1 form.
</p>
        <pre name="code" class="xml">&lt;project name="RunDBPScripts" default="RunScripts"&gt;
&lt;!–-
Execute all scripts in a VS.Net DBP
Author: Jay Harris, http://www.cptloadtest.com, (c) 2005 Jason Harris
License: This work is licensed under a  
   Creative Commons Attribution 3.0 United States License.  
   http://creativecommons.org/licenses/by/3.0/us/ 

This script is offered as-is.
I am not responsible for any misfortunes that may arise from its use.
Use at your own risk.
-–&gt;
&lt;!-– Project: The path of the DBP file –-&gt;
&lt;property name="project" value="Scripts.dbp" overwrite="false" /&gt;
&lt;!-– Server: The machine name of the Database Server –-&gt;
&lt;property name="server" value="localhost" overwrite="false" /&gt;
&lt;!-– Database: The database that the scripts will be run against –-&gt;
&lt;property name="database" value="Northwind" overwrite="false" /&gt;
&lt;target name="RunScripts"&gt;
        &lt;property name="currentpath"
            value="${directory::get-parent-directory(project)}" /&gt;
        &lt;foreach item="Line" property="ProjectLineItem" in="${project}"&gt;
            &lt;if test="${string::contains(ProjectLineItem, 'Begin Folder = ')}"&gt;
                &lt;regex pattern="Folder = &amp;quot;(?’ProjectFolder’.*)&amp;quot;$"
                    input="${string::trim(ProjectLineItem)}" /&gt;
                &lt;property name="currentpath"
                    value="${path::combine(currentpath, ProjectFolder)}" /&gt;
            &lt;/if&gt;
            &lt;if test="${string::contains(ProjectLineItem, 'Script = ')}"&gt;
                &lt;regex pattern="Script = &amp;quot;(?’ScriptName’.*)&amp;quot;$"
                    input="${string::trim(ProjectLineItem)}" /&gt;
                &lt;echo message="Executing Change Script (${server+"\"+database}): ${path::combine(currentpath, ScriptName)}" /&gt;
                &lt;exec workingdir="${currentpath}" program="osql"
                    basedir="C:\Program Files\Microsoft SQL Server\80\Tools\Binn"
                    commandline=’-S ${server} -d ${database} -i “${ScriptName}" -n -E -b’ /&gt;
            &lt;/if&gt;
            &lt;if test="${string::trim(ProjectLineItem) == 'End’}"&gt;
                &lt;property name="currentpath"
                    value="${directory::get-parent-directory(currentpath)}" /&gt;
            &lt;/if&gt;
        &lt;/foreach&gt;
    &lt;/target&gt;
&lt;/project&gt;</pre>
        <p>
I used an &lt;EXEC&gt; NAnt task rather than &lt;SQL&gt;. I found that a lot of the
scripts would not execute in the SQL task because of their design. VS Command Files
use OSQL, so that’s what I used. I guess those command files were worth something
after all.
</p>
        <p>
If you know of a better way, or have any suggestions or comments, please let me know.
</p>
        <img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=de45fc73-2205-457c-ac02-5c83a8cd4ad9" />
      </body>
      <title>NAnt and Visual Studio database projects</title>
      <guid isPermaLink="false">http://www.cptloadtest.com/PermaLink,guid,de45fc73-2205-457c-ac02-5c83a8cd4ad9.aspx</guid>
      <link>http://www.cptloadtest.com/2005/08/25/NAnt-And-Visual-Studio-Database-Projects.aspx</link>
      <pubDate>Thu, 25 Aug 2005 16:15:41 GMT</pubDate>
      <description>&lt;p&gt;
With our new &lt;a href="http://www.cptloadtest.com/2005/08/23/DatabaseRestoreThroughNAnt.aspx"&gt;nightly
database restore&lt;/a&gt; we now have the desire to automatically run all of the change
scripts associated with a project. We’ve found a way; I created a NAnt script that
will parse the Visual Studio Database Project (or "DBP") and execute all of the change
scripts in it. Here’s how we got there.
&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;Problem 1: Visual Studio Command Files are worthless
&lt;/h3&gt;
&lt;p&gt;
Our first idea was to have everyone update a command file in the DBP, and have NAnt
run it every night. Visual Studio command files are great and all, but we have discovered
a problem with them: they do not keep the files in order. We have named all of our
folders (01 DDL, 02 DML, etc) and our change scripts (0001 Create MyTable.sql, 0002
AddInfoColumn to MyTable.sql) accordingly so that they &lt;em&gt;should&lt;/em&gt; run in order.
We have found that the command file feature of VS.Net 2003 does not keep them in order
but rather seems to sort them first by extension, then by order, or some similar oddness.
Obviously, if I try to at InfoColumn to MyTable before MyTable exists, I’m going to
have a problem. So, the command file idea was axed.
&lt;/p&gt;
&lt;h3&gt;Problem 2: Visual SourceSafe contents can’t be trusted
&lt;/h3&gt;
&lt;p&gt;
Our second idea was to VSSGET the DBP directory in VSS and execute every script in
it. However, the VSS store cannot be trusted. If a developer creates a script in VS.Net
called ‘0001 Crate MyTable.sql’ and checks it in to the project, then proceeds to
correct the spelling error in VS.Net to ‘0001 Create MyTable.sql’, VS does not rename
the old file in VSS. Instead, it removes the old file from the project, renames it
locally, then adds the new name to the project and to VSS. It also never deletes the
old file name from the VSS store. Now, both files (’0001 Crate MyTable.sql’ and ‘0001
Create MyTable.sql’) exist in VSS. Performing a VSSGET and executing all scripts will
run both scripts, which could lead to more troubles.
&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;
So, we can’t use a command file, because it won’t maintain the order. We can’t trust
VSS, since it can have obsolete files. We can only trust the project, but how do we
get a list of files, ourselves?
&lt;/p&gt;
&lt;p&gt;
Fortunately, DBP files are just text in a weird XML-wannabe format. The NAnt script
will open the file and run through it looking for every ‘SCRIPT’ entry in the file.
If it finds a ‘BEGIN something’ entry, it assumes that ’something’ is a folder name,
and appends it to the working path until it finds ‘END’, at which time it returns
to the parent directory.
&lt;/p&gt;
&lt;p&gt;
It’s not perfect. It still runs in to some problems, but here it is in v0.1 form.
&lt;/p&gt;
&lt;pre name="code" class="xml"&gt;&amp;lt;project name="RunDBPScripts" default="RunScripts"&amp;gt;
&amp;lt;!–-
Execute all scripts in a VS.Net DBP
Author: Jay Harris, http://www.cptloadtest.com, (c) 2005 Jason Harris
License: This work is licensed under a  
   Creative Commons Attribution 3.0 United States License.  
   http://creativecommons.org/licenses/by/3.0/us/ 

This script is offered as-is.
I am not responsible for any misfortunes that may arise from its use.
Use at your own risk.
-–&amp;gt;
&amp;lt;!-– Project: The path of the DBP file –-&amp;gt;
&amp;lt;property name="project" value="Scripts.dbp" overwrite="false" /&amp;gt;
&amp;lt;!-– Server: The machine name of the Database Server –-&amp;gt;
&amp;lt;property name="server" value="localhost" overwrite="false" /&amp;gt;
&amp;lt;!-– Database: The database that the scripts will be run against –-&amp;gt;
&amp;lt;property name="database" value="Northwind" overwrite="false" /&amp;gt;
&amp;lt;target name="RunScripts"&amp;gt;
        &amp;lt;property name="currentpath"
            value="${directory::get-parent-directory(project)}" /&amp;gt;
        &amp;lt;foreach item="Line" property="ProjectLineItem" in="${project}"&amp;gt;
            &amp;lt;if test="${string::contains(ProjectLineItem, 'Begin Folder = ')}"&amp;gt;
                &amp;lt;regex pattern="Folder = &amp;amp;quot;(?’ProjectFolder’.*)&amp;amp;quot;$"
                    input="${string::trim(ProjectLineItem)}" /&amp;gt;
                &amp;lt;property name="currentpath"
                    value="${path::combine(currentpath, ProjectFolder)}" /&amp;gt;
            &amp;lt;/if&amp;gt;
            &amp;lt;if test="${string::contains(ProjectLineItem, 'Script = ')}"&amp;gt;
                &amp;lt;regex pattern="Script = &amp;amp;quot;(?’ScriptName’.*)&amp;amp;quot;$"
                    input="${string::trim(ProjectLineItem)}" /&amp;gt;
                &amp;lt;echo message="Executing Change Script (${server+"\"+database}): ${path::combine(currentpath, ScriptName)}" /&amp;gt;
                &amp;lt;exec workingdir="${currentpath}" program="osql"
                    basedir="C:\Program Files\Microsoft SQL Server\80\Tools\Binn"
                    commandline=’-S ${server} -d ${database} -i “${ScriptName}" -n -E -b’ /&amp;gt;
            &amp;lt;/if&amp;gt;
            &amp;lt;if test="${string::trim(ProjectLineItem) == 'End’}"&amp;gt;
                &amp;lt;property name="currentpath"
                    value="${directory::get-parent-directory(currentpath)}" /&amp;gt;
            &amp;lt;/if&amp;gt;
        &amp;lt;/foreach&amp;gt;
    &amp;lt;/target&amp;gt;
&amp;lt;/project&amp;gt;&lt;/pre&gt;
&lt;p&gt;
I used an &amp;lt;EXEC&amp;gt; NAnt task rather than &amp;lt;SQL&amp;gt;. I found that a lot of the
scripts would not execute in the SQL task because of their design. VS Command Files
use OSQL, so that’s what I used. I guess those command files were worth something
after all.
&lt;/p&gt;
&lt;p&gt;
If you know of a better way, or have any suggestions or comments, please let me know.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=de45fc73-2205-457c-ac02-5c83a8cd4ad9" /&gt;</description>
      <comments>http://www.cptloadtest.com/CommentView,guid,de45fc73-2205-457c-ac02-5c83a8cd4ad9.aspx</comments>
      <category>Continuous Integration</category>
      <category>NAnt</category>
      <category>Task Automation</category>
      <category>Visual Studio</category>
    </item>
    <item>
      <trackback:ping>http://www.cptloadtest.com/Trackback.aspx?guid=2daf105a-c324-4e4b-b720-d4d0ffbe3d2b</trackback:ping>
      <pingback:server>http://www.cptloadtest.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.cptloadtest.com/PermaLink,guid,2daf105a-c324-4e4b-b720-d4d0ffbe3d2b.aspx</pingback:target>
      <dc:creator>Jay Harris</dc:creator>
      <wfw:comment>http://www.cptloadtest.com/CommentView,guid,2daf105a-c324-4e4b-b720-d4d0ffbe3d2b.aspx</wfw:comment>
      <wfw:commentRss>http://www.cptloadtest.com/SyndicationService.asmx/GetEntryCommentsRss?guid=2daf105a-c324-4e4b-b720-d4d0ffbe3d2b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hopefully this will save a few of you some time: I have created a registry entry that
will create file associations and commands for your NAnt .build files. It will associate
.build files as “NAnt Build Files” and create two commands for right-clicking a .build
file in Explorer: “Edit” will open the file in Notepad; “Run” will execute the file
in NAnt using a persistent command window (the window won’t disappear when the script
is finished).
</p>
        <h3>NAnt Build File Associations
</h3>
        <blockquote>
          <p>
Windows Registry Editor Version 5.00
</p>
          <p>
[HKEY_CLASSES_ROOT\.build]<br />
@=”build_auto_file”
</p>
          <p>
[HKEY_CLASSES_ROOT\build_auto_file]<br />
@=”NAnt Build File”<br />
“EditFlags”=dword:00000000<br />
“BrowserFlags”=dword:00000008
</p>
          <p>
[HKEY_CLASSES_ROOT\build_auto_file\shell]<br />
@=”Edit”
</p>
          <p>
[HKEY_CLASSES_ROOT\build_auto_file\shell\&amp;Run]<br />
@=”Run”
</p>
          <p>
[HKEY_CLASSES_ROOT\build_auto_file\shell\&amp;Run\command]<br />
@=”C:\WINDOWS\system32\CMD.EXE /k “C:\Program Files\NAnt\bin\NAnt.exe” -buildfile:%1″
</p>
          <p>
[HKEY_CLASSES_ROOT\build_auto_file\shell\&amp;Run\ddeexec]
</p>
          <p>
[HKEY_CLASSES_ROOT\build_auto_file\shell\&amp;Run\ddeexec\Application]<br />
@=”NAnt”
</p>
          <p>
[HKEY_CLASSES_ROOT\build_auto_file\shell\&amp;Run\ddeexec\Topic]<br />
@=”System”
</p>
          <p>
[HKEY_CLASSES_ROOT\build_auto_file\shell\edit]<br />
@=”&amp;Edit”
</p>
          <p>
[HKEY_CLASSES_ROOT\build_auto_file\shell\edit\command]<br />
@=”C:\WINDOWS\system32\NOTEPAD.EXE %1″
</p>
          <p>
[HKEY_CLASSES_ROOT\build_auto_file\shell\edit\ddeexec]
</p>
          <p>
[HKEY_CLASSES_ROOT\build_auto_file\shell\edit\ddeexec\Application]<br />
@=”NOTEPAD”
</p>
          <p>
[HKEY_CLASSES_ROOT\build_auto_file\shell\edit\ddeexec\Topic]<br />
@=”System” 
</p>
        </blockquote>
        <p>
Use this code/file at your own risk. I offer it as is, without any support. By downloading
this file or using this code you take full responsibility for any repercussions that
it may have on your computer.
</p>
        <img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=2daf105a-c324-4e4b-b720-d4d0ffbe3d2b" />
      </body>
      <title>Run NAnt .build files from explorer</title>
      <guid isPermaLink="false">http://www.cptloadtest.com/PermaLink,guid,2daf105a-c324-4e4b-b720-d4d0ffbe3d2b.aspx</guid>
      <link>http://www.cptloadtest.com/2005/08/11/Run-NAnt-Build-Files-From-Explorer.aspx</link>
      <pubDate>Thu, 11 Aug 2005 17:46:23 GMT</pubDate>
      <description>&lt;p&gt;
Hopefully this will save a few of you some time: I have created a registry entry that
will create file associations and commands for your NAnt .build files. It will associate
.build files as “NAnt Build Files” and create two commands for right-clicking a .build
file in Explorer: “Edit” will open the file in Notepad; “Run” will execute the file
in NAnt using a persistent command window (the window won’t disappear when the script
is finished).
&lt;/p&gt;
&lt;h3&gt;NAnt Build File Associations
&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;
Windows Registry Editor Version 5.00
&lt;/p&gt;
&lt;p&gt;
[HKEY_CLASSES_ROOT\.build]&lt;br&gt;
@=”build_auto_file”
&lt;/p&gt;
&lt;p&gt;
[HKEY_CLASSES_ROOT\build_auto_file]&lt;br&gt;
@=”NAnt Build File”&lt;br&gt;
“EditFlags”=dword:00000000&lt;br&gt;
“BrowserFlags”=dword:00000008
&lt;/p&gt;
&lt;p&gt;
[HKEY_CLASSES_ROOT\build_auto_file\shell]&lt;br&gt;
@=”Edit”
&lt;/p&gt;
&lt;p&gt;
[HKEY_CLASSES_ROOT\build_auto_file\shell\&amp;amp;Run]&lt;br&gt;
@=”Run”
&lt;/p&gt;
&lt;p&gt;
[HKEY_CLASSES_ROOT\build_auto_file\shell\&amp;amp;Run\command]&lt;br&gt;
@=”C:\WINDOWS\system32\CMD.EXE /k “C:\Program Files\NAnt\bin\NAnt.exe” -buildfile:%1″
&lt;/p&gt;
&lt;p&gt;
[HKEY_CLASSES_ROOT\build_auto_file\shell\&amp;amp;Run\ddeexec]
&lt;/p&gt;
&lt;p&gt;
[HKEY_CLASSES_ROOT\build_auto_file\shell\&amp;amp;Run\ddeexec\Application]&lt;br&gt;
@=”NAnt”
&lt;/p&gt;
&lt;p&gt;
[HKEY_CLASSES_ROOT\build_auto_file\shell\&amp;amp;Run\ddeexec\Topic]&lt;br&gt;
@=”System”
&lt;/p&gt;
&lt;p&gt;
[HKEY_CLASSES_ROOT\build_auto_file\shell\edit]&lt;br&gt;
@=”&amp;amp;Edit”
&lt;/p&gt;
&lt;p&gt;
[HKEY_CLASSES_ROOT\build_auto_file\shell\edit\command]&lt;br&gt;
@=”C:\WINDOWS\system32\NOTEPAD.EXE %1″
&lt;/p&gt;
&lt;p&gt;
[HKEY_CLASSES_ROOT\build_auto_file\shell\edit\ddeexec]
&lt;/p&gt;
&lt;p&gt;
[HKEY_CLASSES_ROOT\build_auto_file\shell\edit\ddeexec\Application]&lt;br&gt;
@=”NOTEPAD”
&lt;/p&gt;
&lt;p&gt;
[HKEY_CLASSES_ROOT\build_auto_file\shell\edit\ddeexec\Topic]&lt;br&gt;
@=”System” 
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
Use this code/file at your own risk. I offer it as is, without any support. By downloading
this file or using this code you take full responsibility for any repercussions that
it may have on your computer.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=2daf105a-c324-4e4b-b720-d4d0ffbe3d2b" /&gt;</description>
      <comments>http://www.cptloadtest.com/CommentView,guid,2daf105a-c324-4e4b-b720-d4d0ffbe3d2b.aspx</comments>
      <category>NAnt</category>
      <category>Task Automation</category>
      <category>Tools</category>
    </item>
  </channel>
</rss>