<?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>Logaan's Site &#187; MSBuild</title>
	<atom:link href="http://www.logaans-site.co.uk/tag/msbuild/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.logaans-site.co.uk</link>
	<description>In my own little world, world...world</description>
	<lastBuildDate>Thu, 29 Jul 2010 18:02:36 +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>MSBuild creating lots of temp files</title>
		<link>http://www.logaans-site.co.uk/2009/10/23/msbuild-creating-lots-of-temp-files/</link>
		<comments>http://www.logaans-site.co.uk/2009/10/23/msbuild-creating-lots-of-temp-files/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 09:19:49 +0000</pubDate>
		<dc:creator>Logaan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[MSBuild]]></category>

		<guid isPermaLink="false">http://www.logaans-site.co.uk/?p=497</guid>
		<description><![CDATA[UPDATE: I found a msdn forum post with exactly the same issue: http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/42647eff-ecb8-412c-a884-a152b6fdd40d It turns out that it is NOT msbuild but it is SN.exe leaving the temp files behind when resigning assemblies. I suppose you could easily come to this conclusion when watching the build and those files are flashing by so quickly. On [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE: </strong></p>
<p>I found a msdn forum post with exactly the same issue: <a href="http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/42647eff-ecb8-412c-a884-a152b6fdd40d" target="_blank">http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/42647eff-ecb8-412c-a884-a152b6fdd40d</a></p>
<p>It turns out that it is <strong>NOT</strong> msbuild but it is SN.exe leaving the temp files behind when resigning assemblies. I suppose you could easily come to this conclusion when watching the build and those files are flashing by so quickly.</p>
<p>On reflection a custom task will not help either&#8230;</p>
<p>This post has more details on the issue with a link to a hot fix for Server 2003: <a href="http://blogs.msdn.com/pfedev/archive/2008/10/24/sn-exe-and-empty-temp-files-in-temp.aspx" target="_blank">http://blogs.msdn.com/pfedev/archive/2008/10/24/sn-exe-and-empty-temp-files-in-temp.aspx</a></p>
<p>If you are using Server 2008 I would not recommend installing it.</p>
<p><span id="more-497"></span><br />
<strong>Original:</strong></p>
<p>Recently at work we have be observing a very odd behaviour, a particular set of builds has been slowing by about 30 minutes every night.</p>
<p>We discovered that hundreds of temporary files were being created by the msbuild exec task. What happens is that the exec task will created a temp file, then use the temp file name to create a batch file with the command in it. In most cases it will delete the temp file and the batch file. If you are quick enough you can pause the build and look in the temp folder and observe these files.</p>
<p>Now the strange thing is we have observed a specific case of when msbuild will not delete that temporary file, thus adding a cumalative amount of time every night when it is trying to find a new temp file name. This occurs when we resign our assemblies using SN. If you use SN to verify the assemblies the temp file is cleaned up afterwards.</p>
<p>This is quite a baffling problem, when calling the same executable with a different command it just works, seems odd to me that it would cause such an issue. There is also little on the internet that hints at this issue, I suppose if people are careul and look after the servers with regular cleanup tasks this issue might never arise.</p>
<p>So at the moment to work around the issue we have written temp folder clean up tasks and a sceduled disk clean up task on the server. I might write a set of specific tasks wrapping the SN executable and its command line arguments to reduce the need for such measures.</p>
<p>If I can get any sort of grasp on the actual issue then I will create and link to an MSConnect issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logaans-site.co.uk/2009/10/23/msbuild-creating-lots-of-temp-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Validator</title>
		<link>http://www.logaans-site.co.uk/2009/04/27/project-validator/</link>
		<comments>http://www.logaans-site.co.uk/2009/04/27/project-validator/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 08:52:36 +0000</pubDate>
		<dc:creator>Logaan</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[MSBuild]]></category>

		<guid isPermaLink="false">http://www.logaans-site.co.uk/?p=441</guid>
		<description><![CDATA[As an idea that compliments the previous validator I built, this msbuild task will search for all the projects in a given path and check that they are all building to the correct path. Download source To use just define two properties: SearchPath, which is the parent folder to start looking in. It will search [...]]]></description>
			<content:encoded><![CDATA[<p>As an idea that compliments the previous validator I built, this msbuild task will search for all the projects in a given path and check that they are all building to the correct path.</p>
<p><a href="http://www.logaans-site.co.uk/wp-content/uploads/2009/04/projectvalidator.zip">Download source</a></p>
<p>To use just define two properties: SearchPath, which is the parent folder to start looking in. It will search all subfolders as well by default. And BuildFolder, which is the desired target for building to.</p>
<p>All it does is very simple substring matching to check that it is valid.</p>
<p>For example, if I build a project to <em>..\bin\Debug</em> and <em>..\bin\Release</em> and the specify my build folder is <em>..\bin</em> then both paths are valid. But if one of the build targets was set to something like <em>..\foo</em> then it would be invalid</p>
<p>Again, this validator could be extended to check other parts of the project files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logaans-site.co.uk/2009/04/27/project-validator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Assembly Validator</title>
		<link>http://www.logaans-site.co.uk/2009/04/25/assemvly-validator/</link>
		<comments>http://www.logaans-site.co.uk/2009/04/25/assemvly-validator/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 12:52:18 +0000</pubDate>
		<dc:creator>Logaan</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[MSBuild]]></category>

		<guid isPermaLink="false">http://www.logaans-site.co.uk/?p=437</guid>
		<description><![CDATA[Due to a really subtle problem with our build scripts and project settings at work, we were releasing a debug assembly. So I built this MSBuild task to validate the assemblies after they have been built. Download Source It is very simple to use. Create a property called ExpectedConfiguration that has the configuration. Create inclusion [...]]]></description>
			<content:encoded><![CDATA[<p>Due to a really subtle problem with our build scripts and project settings at work, we were releasing a debug assembly.</p>
<p>So I built this MSBuild task to validate the assemblies after they have been built.</p>
<p><a href="http://www.logaans-site.co.uk/wp-content/uploads/2009/04/assemblyvalidator.zip">Download Source</a></p>
<p>It is very simple to use.</p>
<p>Create a property called ExpectedConfiguration that has the configuration.</p>
<p>Create inclusion and exclusion item groups called AssemblyInclusions and AssemblyExceptions.</p>
<p>Then use the ValidateAssemblies target.</p>
<p>It will then look for all assemblies and validate each ones configuration attribute.</p>
<p>This could be extended to validate assemblies much more extensively, like checking publisher and copyrigth details etc</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logaans-site.co.uk/2009/04/25/assemvly-validator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
