<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Automating the build with MSBuild (part three)</title>
	<atom:link href="http://codingcockerel.co.uk/2008/05/05/automating-the-build-with-msbuild-part-three/feed/" rel="self" type="application/rss+xml" />
	<link>http://codingcockerel.co.uk/2008/05/05/automating-the-build-with-msbuild-part-three/</link>
	<description>Getting the job done with .NET</description>
	<lastBuildDate>Thu, 09 Sep 2010 14:56:27 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: The Earl</title>
		<link>http://codingcockerel.co.uk/2008/05/05/automating-the-build-with-msbuild-part-three/comment-page-1/#comment-7730</link>
		<dc:creator>The Earl</dc:creator>
		<pubDate>Mon, 23 Aug 2010 16:13:41 +0000</pubDate>
		<guid isPermaLink="false">http://codingcockerel.co.uk/?p=13#comment-7730</guid>
		<description>You can emulate the publish web project menu command by calling the built in ‘PipelinePreDeployCopyAllFilesToOneFolder’ target.

MSBuild [web project.csproj] /T:Clean;Build;PipelinePreDeployCopyAllFilesToOneFolder
/p:_PackageTempDir=[publish folder];Configuration=Release

I lost days of my life looking for that one :(</description>
		<content:encoded><![CDATA[<p>You can emulate the publish web project menu command by calling the built in ‘PipelinePreDeployCopyAllFilesToOneFolder’ target.</p>
<p>MSBuild [web project.csproj] /T:Clean;Build;PipelinePreDeployCopyAllFilesToOneFolder<br />
/p:_PackageTempDir=[publish folder];Configuration=Release</p>
<p>I lost days of my life looking for that one <img src='http://codingcockerel.co.uk/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CSharpGuru</title>
		<link>http://codingcockerel.co.uk/2008/05/05/automating-the-build-with-msbuild-part-three/comment-page-1/#comment-7451</link>
		<dc:creator>CSharpGuru</dc:creator>
		<pubDate>Mon, 21 Jun 2010 22:45:21 +0000</pubDate>
		<guid isPermaLink="false">http://codingcockerel.co.uk/?p=13#comment-7451</guid>
		<description>Thank you so much for your post. It saved me lots of headaches in a new job trying to set up automated builds in a pretty complex environment...kudos!</description>
		<content:encoded><![CDATA[<p>Thank you so much for your post. It saved me lots of headaches in a new job trying to set up automated builds in a pretty complex environment&#8230;kudos!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: codingcockerel</title>
		<link>http://codingcockerel.co.uk/2008/05/05/automating-the-build-with-msbuild-part-three/comment-page-1/#comment-6838</link>
		<dc:creator>codingcockerel</dc:creator>
		<pubDate>Tue, 09 Mar 2010 12:25:45 +0000</pubDate>
		<guid isPermaLink="false">http://codingcockerel.co.uk/?p=13#comment-6838</guid>
		<description>Hi Nam,

It might be worth trying some of the other solutions suggested in the comments, particularly those from KJ.</description>
		<content:encoded><![CDATA[<p>Hi Nam,</p>
<p>It might be worth trying some of the other solutions suggested in the comments, particularly those from KJ.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nam Gi VU</title>
		<link>http://codingcockerel.co.uk/2008/05/05/automating-the-build-with-msbuild-part-three/comment-page-1/#comment-6836</link>
		<dc:creator>Nam Gi VU</dc:creator>
		<pubDate>Tue, 09 Mar 2010 10:11:39 +0000</pubDate>
		<guid isPermaLink="false">http://codingcockerel.co.uk/?p=13#comment-6836</guid>
		<description>I&#039;ve used &quot;Run as administrator&quot; the cmd to open the command line and run msbuild but the task WebDirectoryDelete and WebDirectoryCreate failed with error 0x80005000.

Please update solution.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve used &#8220;Run as administrator&#8221; the cmd to open the command line and run msbuild but the task WebDirectoryDelete and WebDirectoryCreate failed with error 0&#215;80005000.</p>
<p>Please update solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KJ</title>
		<link>http://codingcockerel.co.uk/2008/05/05/automating-the-build-with-msbuild-part-three/comment-page-1/#comment-3590</link>
		<dc:creator>KJ</dc:creator>
		<pubDate>Thu, 11 Jun 2009 13:05:11 +0000</pubDate>
		<guid isPermaLink="false">http://codingcockerel.co.uk/?p=13#comment-3590</guid>
		<description>Sorry folks...  here&#039;s a re-post:



I figured it out.

I stopped trying to use the code in my original post because I just couldn’t get it to work, and imported this library instead:

Import Project=(MSBuildExtensionsPath)\SDCTasks\Microsoft.Sdc.Common.tasks


Here’s the code to create and delete web sites in IIS. Please note that this works remotely, meaning I can create and delete web sites on a machine that’s not the TFSBuild machine (providing file system permissions is not an issue of course):

    PropertyGroup
        -- Set properties for web site and app pool operations --
        WebSiteName   MATX.Healthcare.AdminService   /WebSiteName
        ServerName      AUSTX010PROD                           /ServerName
        PortNumber       65501                                           /PortNumber
        IISNetworkDir    D:\Healthcare\AdminService       /IISNetworkDir
   /PropertyGroup


    Target Name=&quot;DeleteWebSiteInIIS&quot;
        Message Text=&quot;****** DeleteWebSiteInIIS&quot;

       Web.WebSite.DeleteWebsite
                MachineName=&quot;(ServerName)
                Description=&quot;(WebSiteName)
    /Target



    Target Name=&quot;CreateWebSiteInIIS&quot;
        Message Text=&quot;******CreateWebSiteInIIS&quot;

        Web.WebSite.Create
                Description=&quot;(WebSiteName)&quot;
                Path=&quot;(IISNetworkDir)&quot;
                MachineName=&quot;(ServerName)&quot;
                Port=&quot;(PortNumber)&quot;
                AppPoolID=&quot;Services&quot;
                DefaultDocs=&quot;AdminService.svc;Default.aspx;Default.html;Default.asp;index.htm&quot;
    /Target


I found and used the info from this web site and it works perfectly:

http://grounding.co.za/blogs/romiko/archive/2008/09/20/msbuild-creating-professional-deployment-scripts-part-1.aspx</description>
		<content:encoded><![CDATA[<p>Sorry folks&#8230;  here&#8217;s a re-post:</p>
<p>I figured it out.</p>
<p>I stopped trying to use the code in my original post because I just couldn’t get it to work, and imported this library instead:</p>
<p>Import Project=(MSBuildExtensionsPath)\SDCTasks\Microsoft.Sdc.Common.tasks</p>
<p>Here’s the code to create and delete web sites in IIS. Please note that this works remotely, meaning I can create and delete web sites on a machine that’s not the TFSBuild machine (providing file system permissions is not an issue of course):</p>
<p>    PropertyGroup<br />
        &#8212; Set properties for web site and app pool operations &#8211;<br />
        WebSiteName   MATX.Healthcare.AdminService   /WebSiteName<br />
        ServerName      AUSTX010PROD                           /ServerName<br />
        PortNumber       65501                                           /PortNumber<br />
        IISNetworkDir    D:\Healthcare\AdminService       /IISNetworkDir<br />
   /PropertyGroup</p>
<p>    Target Name=&#8221;DeleteWebSiteInIIS&#8221;<br />
        Message Text=&#8221;****** DeleteWebSiteInIIS&#8221;</p>
<p>       Web.WebSite.DeleteWebsite<br />
                MachineName=&#8221;(ServerName)<br />
                Description=&#8221;(WebSiteName)<br />
    /Target</p>
<p>    Target Name=&#8221;CreateWebSiteInIIS&#8221;<br />
        Message Text=&#8221;******CreateWebSiteInIIS&#8221;</p>
<p>        Web.WebSite.Create<br />
                Description=&#8221;(WebSiteName)&#8221;<br />
                Path=&#8221;(IISNetworkDir)&#8221;<br />
                MachineName=&#8221;(ServerName)&#8221;<br />
                Port=&#8221;(PortNumber)&#8221;<br />
                AppPoolID=&#8221;Services&#8221;<br />
                DefaultDocs=&#8221;AdminService.svc;Default.aspx;Default.html;Default.asp;index.htm&#8221;<br />
    /Target</p>
<p>I found and used the info from this web site and it works perfectly:</p>
<p><a href="http://grounding.co.za/blogs/romiko/archive/2008/09/20/msbuild-creating-professional-deployment-scripts-part-1.aspx" rel="nofollow">http://grounding.co.za/blogs/romiko/archive/2008/09/20/msbuild-creating-professional-deployment-scripts-part-1.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KJ</title>
		<link>http://codingcockerel.co.uk/2008/05/05/automating-the-build-with-msbuild-part-three/comment-page-1/#comment-3589</link>
		<dc:creator>KJ</dc:creator>
		<pubDate>Thu, 11 Jun 2009 12:57:25 +0000</pubDate>
		<guid isPermaLink="false">http://codingcockerel.co.uk/?p=13#comment-3589</guid>
		<description>I figured it out.

I stopped trying to use the code in my original post because I just couldn&#039;t get it to work, and imported this library instead:
    

Here&#039;s the code to create and delete web sites in IIS.  Please note that this works remotely, meaning I can create and delete web sites on a machine that&#039;s not the TFSBuild machine (providing file system permissions is not an issue of course):

     
       &lt;!-- Set properties for web site and app pool operations --&gt;
        MATX.Healthcare.AdminService
        AUSTX010PROD
        65501
        D:\Healthcare\AdminService
    


    
        

        
    


    
        &lt;Message Text********** CreateWebSiteInIIS ********** 

        
    


I found and used the info from this web site and it works perfectly:

http://grounding.co.za/blogs/romiko/archive/2008/09/20/msbuild-creating-professional-deployment-scripts-part-1.aspx</description>
		<content:encoded><![CDATA[<p>I figured it out.</p>
<p>I stopped trying to use the code in my original post because I just couldn&#8217;t get it to work, and imported this library instead:</p>
<p>Here&#8217;s the code to create and delete web sites in IIS.  Please note that this works remotely, meaning I can create and delete web sites on a machine that&#8217;s not the TFSBuild machine (providing file system permissions is not an issue of course):</p>
<p>       <!-- Set properties for web site and app pool operations --><br />
        MATX.Healthcare.AdminService<br />
        AUSTX010PROD<br />
        65501<br />
        D:\Healthcare\AdminService</p>
<p>        &lt;Message Text********** CreateWebSiteInIIS ********** </p>
<p>I found and used the info from this web site and it works perfectly:</p>
<p><a href="http://grounding.co.za/blogs/romiko/archive/2008/09/20/msbuild-creating-professional-deployment-scripts-part-1.aspx" rel="nofollow">http://grounding.co.za/blogs/romiko/archive/2008/09/20/msbuild-creating-professional-deployment-scripts-part-1.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: codingcockerel</title>
		<link>http://codingcockerel.co.uk/2008/05/05/automating-the-build-with-msbuild-part-three/comment-page-1/#comment-3518</link>
		<dc:creator>codingcockerel</dc:creator>
		<pubDate>Wed, 03 Jun 2009 19:57:14 +0000</pubDate>
		<guid isPermaLink="false">http://codingcockerel.co.uk/?p=13#comment-3518</guid>
		<description>OK good luck. If you get a decent answer please post a link in the comments. Cheers.</description>
		<content:encoded><![CDATA[<p>OK good luck. If you get a decent answer please post a link in the comments. Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KJ</title>
		<link>http://codingcockerel.co.uk/2008/05/05/automating-the-build-with-msbuild-part-three/comment-page-1/#comment-3517</link>
		<dc:creator>KJ</dc:creator>
		<pubDate>Wed, 03 Jun 2009 19:54:34 +0000</pubDate>
		<guid isPermaLink="false">http://codingcockerel.co.uk/?p=13#comment-3517</guid>
		<description>Excellent - thanks Ross.  I&#039;ll post my question there.</description>
		<content:encoded><![CDATA[<p>Excellent &#8211; thanks Ross.  I&#8217;ll post my question there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: codingcockerel</title>
		<link>http://codingcockerel.co.uk/2008/05/05/automating-the-build-with-msbuild-part-three/comment-page-1/#comment-3516</link>
		<dc:creator>codingcockerel</dc:creator>
		<pubDate>Wed, 03 Jun 2009 19:38:03 +0000</pubDate>
		<guid isPermaLink="false">http://codingcockerel.co.uk/?p=13#comment-3516</guid>
		<description>Hi KJ,

Try posting your question on StackOverflow.com, you&#039;re likely to get a quick response there.

Apologies but I haven&#039;t got the time to look at this in detail right now.

Ross</description>
		<content:encoded><![CDATA[<p>Hi KJ,</p>
<p>Try posting your question on StackOverflow.com, you&#8217;re likely to get a quick response there.</p>
<p>Apologies but I haven&#8217;t got the time to look at this in detail right now.</p>
<p>Ross</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KJ</title>
		<link>http://codingcockerel.co.uk/2008/05/05/automating-the-build-with-msbuild-part-three/comment-page-1/#comment-3512</link>
		<dc:creator>KJ</dc:creator>
		<pubDate>Wed, 03 Jun 2009 14:31:01 +0000</pubDate>
		<guid isPermaLink="false">http://codingcockerel.co.uk/?p=13#comment-3512</guid>
		<description>Thank in advance, everyone.

I&#039;m a bit new to working with MSBuild, and I&#039;m having a hard time getting the WebDirectoryDelete and WebDirectoryCreate to work.

SYSTEM:  TFS 2008 SP1 on Windows 2003 Server.  The build machine and TFS server are on the same machine. 

What I want my build script to do is on the target server (not the build/tfs machine), delete the web site and it&#039;s physical directory and then re-create both, then deploy my code.

I cannot get the WebDirectoryDelete to work.  So what I did was edited the build script to try to delete a web site on the TFS Build machine (so everything is local) but that didn&#039;t work either.  

Here&#039;s the code I&#039;m using to try to delete a web site in IIS on my the local TFS build machine:

    &lt;!-- **** Delete the web site in IIS f**** --&gt;
    
        
        
            
            ConfigurationService-Test
            65504
        
        
    

When I run this code I get:
Task &quot;WebDirectoryDelete&quot;
  Deleting virtual directory &#039;ConfigurationService-Test&#039; on &#039;localhost:65504&#039;.
D:\TFSBuilds\Healthcare\testing\BuildType\TFSBuild.proj(30,9): error : The system cannot find the path specified. (Exception from HRESULT: 0x80070003)


I have tried numerous iterations on the above code, specifying the user ID and password, tried specifying &quot;localhost&quot;, \\MachineName - etc.  I just can&#039;t seem to delete the web site in IIS via my build script.

Could someone please point out what I&#039;m doing wrong?  I&#039;m very eager to get this to work, and it seems that others have had success with it.

Thank you.</description>
		<content:encoded><![CDATA[<p>Thank in advance, everyone.</p>
<p>I&#8217;m a bit new to working with MSBuild, and I&#8217;m having a hard time getting the WebDirectoryDelete and WebDirectoryCreate to work.</p>
<p>SYSTEM:  TFS 2008 SP1 on Windows 2003 Server.  The build machine and TFS server are on the same machine. </p>
<p>What I want my build script to do is on the target server (not the build/tfs machine), delete the web site and it&#8217;s physical directory and then re-create both, then deploy my code.</p>
<p>I cannot get the WebDirectoryDelete to work.  So what I did was edited the build script to try to delete a web site on the TFS Build machine (so everything is local) but that didn&#8217;t work either.  </p>
<p>Here&#8217;s the code I&#8217;m using to try to delete a web site in IIS on my the local TFS build machine:</p>
<p>    <!-- **** Delete the web site in IIS f**** --></p>
<p>            ConfigurationService-Test<br />
            65504</p>
<p>When I run this code I get:<br />
Task &#8220;WebDirectoryDelete&#8221;<br />
  Deleting virtual directory &#8216;ConfigurationService-Test&#8217; on &#8216;localhost:65504&#8242;.<br />
D:\TFSBuilds\Healthcare\testing\BuildType\TFSBuild.proj(30,9): error : The system cannot find the path specified. (Exception from HRESULT: 0&#215;80070003)</p>
<p>I have tried numerous iterations on the above code, specifying the user ID and password, tried specifying &#8220;localhost&#8221;, \\MachineName &#8211; etc.  I just can&#8217;t seem to delete the web site in IIS via my build script.</p>
<p>Could someone please point out what I&#8217;m doing wrong?  I&#8217;m very eager to get this to work, and it seems that others have had success with it.</p>
<p>Thank you.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
