<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Codepolice.net &#187; MSBuild</title>
	<atom:link href="http://codepolice.net/tag/msbuild/feed/" rel="self" type="application/rss+xml" />
	<link>http://codepolice.net</link>
	<description>C#, ASP.NET, MVC, LINQ, Wordpress and stuff like that</description>
	<lastBuildDate>Mon, 26 Jul 2010 08:58:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Problems with MSBUILD tasks after playing with Visual Studio 2010</title>
		<link>http://codepolice.net/2010/02/22/problems-with-msbuild-tasks-after-playing-with-visual-studio-2010/</link>
		<comments>http://codepolice.net/2010/02/22/problems-with-msbuild-tasks-after-playing-with-visual-studio-2010/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 11:16:46 +0000</pubDate>
		<dc:creator>Ola</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[MSBuild]]></category>
		<category><![CDATA[visual studio 2010]]></category>
		<category><![CDATA[vs2010]]></category>

		<guid isPermaLink="false">http://codepolice.net/?p=225</guid>
		<description><![CDATA[I use a custom MSBUILD xml file to build some of my projects so that i can run stuff to compress CSS/JS files and stuff like that. After installing Visual Studio 2010 and playing around a bit with suddenly my builds started to fail. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets(132,11): error MSB4064: The "Retries" parameter is not supported [...]]]></description>
			<content:encoded><![CDATA[<p>I use a custom MSBUILD xml file to build some of my projects so that i can run stuff to compress CSS/JS files and stuff like that. After installing Visual Studio 2010 and playing around a bit with suddenly my builds started to fail.</p>
<pre class="brush:shell">C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets(132,11):
error MSB4064: The "Retries" parameter is not supported by the "Copy" task. Verify the parameter exists on the task, and it is a settable public instance property.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets(130,5):
error MSB4063: The "Copy" task could not be initialized with its input parameters.</pre>
<p>After some debugging i realized that Visual Studio 2010 had changed a line in the csproj file of my web application project.</p>
<p><strong>From: </strong></p>
<p><strong>To: </strong></p>
<p>I just had to change this line back to v9.0 to get it to work again. Hopefully this can help someone that has the same problem as me.</p>
<h3>UPDATE!</h3>
<p>Now when the RTM of Visual Studio was released i of course ran into this problem again. This time i tried to find a better solution and found this <a href="http://devlicio.us/blogs/derik_whittaker/archive/2010/02/27/issues-compiling-vs2010-solutions-with-web-projects-from-nant.aspx">post on devlicio</a>. In the comments to that post i found a solution that worked great for me.</p>
<blockquote><p>I had the same issue. I had to alter the MSbuild WebApplication file  located: C:\Program Files  (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications and remove  these entries.</p>
<p>Retries=&#8221;$(CopyRetryCount)&#8221;</p>
<p>and          RetryDelayMilliseconds=&#8221;$(CopyRetryDelayMilliseconds)&#8221;</p>
<p>Once both of these were removed (in 13 places) everything worked  fine. Hope it helps you too.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://codepolice.net/2010/02/22/problems-with-msbuild-tasks-after-playing-with-visual-studio-2010/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Publish web application project failed</title>
		<link>http://codepolice.net/2009/01/14/publish-web-application-project-failed/</link>
		<comments>http://codepolice.net/2009/01/14/publish-web-application-project-failed/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 17:58:19 +0000</pubDate>
		<dc:creator>Ola</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[MSBuild]]></category>
		<category><![CDATA[Publish failed]]></category>
		<category><![CDATA[Publish fails]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[visual studio 2008]]></category>

		<guid isPermaLink="false">http://www.codepolice.net/?p=133</guid>
		<description><![CDATA[I have had huge problems on various projects with the &#8220;publish&#8221; functionality in Visual Studio 2008. I like the feature, you just click publish, choose a directory and the files that is needed on the webserver is placed in the folder and you can easliy copy it to your server or whatever. The problem with [...]]]></description>
			<content:encoded><![CDATA[<p>I have had huge problems on various projects with the &#8220;publish&#8221; functionality in Visual Studio 2008. I like the feature, you just click publish, choose a directory and the files that is needed on the webserver is placed in the folder and you can easliy copy it to your server or whatever.</p>
<p>The problem with it is that it seems to fail from time to time. The output window gives no clues what so ever what has gone wrong so it&#8217;s kind of hard to debug. When you google it you get all sorts of threads and post about people having problems with this but it seems like it a diffrent solution for it everywhere.</p>
<p>Anyway i gave up and started looking towards MSBUILD and found <a href="http://codingcockerel.co.uk/2008/05/18/how-to-publish-a-web-site-with-msbuild/">this great post</a> about how to simulate the behavior of the publish feature with MSBUILD. You just create a Build.xml file and then you run msbuild.exe build.xml. My Build.xml file looks like this.</p>
<div class="codecolorer-container xml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Project</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;</span> <span style="color: #000066;">DefaultTargets</span>=<span style="color: #ff0000;">&quot;Run&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Import</span> <span style="color: #000066;">Project</span>=<span style="color: #ff0000;">&quot;C:\Program Files\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;PropertyGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;OutputFolder<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Publish<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/OutputFolder<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ProjectDir<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>C:\code\<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ProjectDir<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;CompilationDebug</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;CustomErrorsMode</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ContentEditorsEmail</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;AdministratorsEmail</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/PropertyGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;PropertyGroup</span> <span style="color: #000066;">Condition</span>=<span style="color: #ff0000;">&quot;$(Environment) == 'Test'&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;DeploymentFolder<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>C:\Staging\Test<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/DeploymentFolder<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/PropertyGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;PropertyGroup</span> <span style="color: #000066;">Condition</span>=<span style="color: #ff0000;">&quot;$(Environment) == 'Live'&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;DeploymentFolder<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>C:\Staging\Live<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/DeploymentFolder<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/PropertyGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Target</span> <span style="color: #000066;">Name</span>=<span style="color: #ff0000;">&quot;Run&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;CallTarget</span> <span style="color: #000066;">Targets</span>=<span style="color: #ff0000;">&quot;Compile&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;CallTarget</span> <span style="color: #000066;">Targets</span>=<span style="color: #ff0000;">&quot;Publish&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Target</span> <span style="color: #000066;">Name</span>=<span style="color: #ff0000;">&quot;Clean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ItemGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;BinFiles</span> <span style="color: #000066;">Include</span>=<span style="color: #ff0000;">&quot;bin\*.*&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ItemGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Delete</span> <span style="color: #000066;">Files</span>=<span style="color: #ff0000;">&quot;@(BinFiles)&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Target</span> <span style="color: #000066;">Name</span>=<span style="color: #ff0000;">&quot;Compile&quot;</span> <span style="color: #000066;">DependsOnTargets</span>=<span style="color: #ff0000;">&quot;Clean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;MSBuild</span> <span style="color: #000066;">Projects</span>=<span style="color: #ff0000;">&quot;myproject.csproj&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Target</span> <span style="color: #000066;">Name</span>=<span style="color: #ff0000;">&quot;Publish&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;RemoveDir</span> <span style="color: #000066;">Directories</span>=<span style="color: #ff0000;">&quot;$(OutputFolder)&quot;</span> <span style="color: #000066;">ContinueOnError</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;MSBuild</span> <span style="color: #000066;">Projects</span>=<span style="color: #ff0000;">&quot;myproject.csproj&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">Targets</span>=<span style="color: #ff0000;">&quot;ResolveReferences;_CopyWebApplication&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">Properties</span>=<span style="color: #ff0000;">&quot;WebProjectOutputDir=$(OutputFolder);OutDir=$(WebProjectOutputDir)\&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>This works great for me for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://codepolice.net/2009/01/14/publish-web-application-project-failed/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Finally have Subversion + CruiseControl.NET + MSBuild running</title>
		<link>http://codepolice.net/2008/11/06/finally-have-subversion-cruisecontrolnet-msbuild-running/</link>
		<comments>http://codepolice.net/2008/11/06/finally-have-subversion-cruisecontrolnet-msbuild-running/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 16:49:06 +0000</pubDate>
		<dc:creator>Ola</dc:creator>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[CruiseControl.NET]]></category>
		<category><![CDATA[Microsoft.WebApplication.targets]]></category>
		<category><![CDATA[MSBuild]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Web application Project]]></category>

		<guid isPermaLink="false">http://www.codepolice.net/?p=33</guid>
		<description><![CDATA[I&#8217;ve been struggling the whole afternoon to get some kind of continuous integration up and running. It started with that i got sick and tired of the Publish feature in Visual Studio 2008 because it just starts to fail from time to time and its kind of impossible to find out why because it doesn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been struggling the whole afternoon to get some kind of continuous integration up and running. It started with that i got sick and tired of the <strong>Publish</strong> feature in Visual Studio 2008 because it just starts to fail from time to time and its kind of impossible to find out why because it doesn&#8217;t give any kind of error information.</p>
<p>Anyway i started to look at MSBuild and see if it could handle my Publish task and i found <a href="http://codingcockerel.co.uk/2008/05/18/how-to-publish-a-web-site-with-msbuild/">this great article</a>. It explains how to make a build file that build your project and then also simulate the publish feature and put just the files necessary into a separate folder.</p>
<p>While i was on the subject i thought that i could as well see if i could set up my source control machine to build my app as soon as i check in some files, copy the build to a folder and make that folder a web application.</p>
<p>I actually was kind of easy. I found an <a href="http://msmvps.com/blogs/omar/archive/2008/10/06/asp-net-website-continuous-integration-deployment-using-cruisecontrol-net-subversion-msbuild-and-robocopy.aspx">article by Omar Al Zabir</a> that explains this in great detail.</p>
<p><strong>Not any problem at all?</strong></p>
<p>Ofcourse. The one i had most problem with was the infamous <strong>Microsoft.WebApplication.targets</strong> bug. When you build your project on the build machine you get this error.</p>
<p><em>error MSB4019: The imported project &#8220;C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets&#8221; was not found. Confirm that the path in the &lt;Import&gt; declaration is correct, and that the file exists on disk.</em></p>
<p>I have had this problem before when we migrated a &#8220;Website&#8221; to a &#8220;Web application project&#8221; at my last job. What i remembered from it was that you had to copy the file Microsoft.WebApplication.targets from it&#8217;s location on your dev machine to the build machine. Well fine. The problem in my case was that the file already was there. I looked around for maybe an hour or until i realized that the path on my build machine was:</p>
<p><em>C:\Program Files\MSBuild\Microsoft\Visual Studio\v9.0\WebApplications\Microsoft.WebApplication.targets</em></p>
<p>While on my dev machine it was:</p>
<p><em>C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets</em></p>
<p>Notice the difference? Don&#8217;t you just love Microsoft sometimes .. just copy the path and remove the space from &#8220;Visual Studio&#8221; and it works.</p>
<p>That was actually the only major problem i had. Otherwise i used my brain and the articles i linked to and everything is happy puppy.</p>
<p>Thanks and good night.</p>
<p>Link: <a href="http://codingcockerel.co.uk/2008/05/18/how-to-publish-a-web-site-with-msbuild/">How to publish a web site with MSBuild</a>, <a href="http://msmvps.com/blogs/omar/archive/2008/10/06/asp-net-website-continuous-integration-deployment-using-cruisecontrol-net-subversion-msbuild-and-robocopy.aspx">ASP.NET website Continuous Integration+Deployment using CruiseControl.NET, Subversion, MSBuild and Robocopy</a></p>
]]></content:encoded>
			<wfw:commentRss>http://codepolice.net/2008/11/06/finally-have-subversion-cruisecontrolnet-msbuild-running/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->