<?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: Powershell: Load assembly without locking file.</title>
	<atom:link href="http://elegantcode.com/2009/12/22/powershell-load-assembly-without-locking-file/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2009/12/22/powershell-load-assembly-without-locking-file/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=powershell-load-assembly-without-locking-file</link>
	<description></description>
	<lastBuildDate>Sun, 12 Feb 2012 18:54:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
	<item>
		<title>By: James</title>
		<link>http://elegantcode.com/2009/12/22/powershell-load-assembly-without-locking-file/comment-page-1/#comment-52187</link>
		<dc:creator>James</dc:creator>
		<pubDate>Thu, 31 Dec 2009 00:37:21 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/12/22/powershell-load-assembly-without-locking-file/#comment-52187</guid>
		<description>What happens if the assembly you are loading depends on types defined in another assembly that has not yet been loaded?

I seem to recall I had issues with this when I did the workaround of loading a byte array in the past.</description>
		<content:encoded><![CDATA[<p>What happens if the assembly you are loading depends on types defined in another assembly that has not yet been loaded?</p>
<p>I seem to recall I had issues with this when I did the workaround of loading a byte array in the past.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Hill</title>
		<link>http://elegantcode.com/2009/12/22/powershell-load-assembly-without-locking-file/comment-page-1/#comment-52030</link>
		<dc:creator>Keith Hill</dc:creator>
		<pubDate>Tue, 29 Dec 2009 00:01:43 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/12/22/powershell-load-assembly-without-locking-file/#comment-52030</guid>
		<description>Here&#039;s a simpler way to read a file&#039;s bytes: $bytes = [io.file]::ReadAllBytes($path)</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a simpler way to read a file&#8217;s bytes: $bytes = [io.file]::ReadAllBytes($path)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Jarrett</title>
		<link>http://elegantcode.com/2009/12/22/powershell-load-assembly-without-locking-file/comment-page-1/#comment-51788</link>
		<dc:creator>Jason Jarrett</dc:creator>
		<pubDate>Wed, 23 Dec 2009 13:43:54 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/12/22/powershell-load-assembly-without-locking-file/#comment-51788</guid>
		<description>@Rennie - I can&#039;t say I know exactly how powershell was handling the loading of multiple dll&#039;s into the same session. I did, however, notice that it was picking up the new &quot;version&quot; every time my build ran and did not get the &quot;cannot load assembly because it already exists in the app domain&quot; exception.

Thanks to @Martin, my get-assembly-version has been updated with his great suggestion.</description>
		<content:encoded><![CDATA[<p>@Rennie &#8211; I can&#8217;t say I know exactly how powershell was handling the loading of multiple dll&#8217;s into the same session. I did, however, notice that it was picking up the new &#8220;version&#8221; every time my build ran and did not get the &#8220;cannot load assembly because it already exists in the app domain&#8221; exception.</p>
<p>Thanks to @Martin, my get-assembly-version has been updated with his great suggestion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://elegantcode.com/2009/12/22/powershell-load-assembly-without-locking-file/comment-page-1/#comment-51782</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Wed, 23 Dec 2009 09:04:58 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/12/22/powershell-load-assembly-without-locking-file/#comment-51782</guid>
		<description>If it&#039;s just for getting the assembly version you could also use

[System.Reflection.AssemblyName]::GetAssemblyName(string file)

It opens, reads and closes the assembly to get the version information, but does not add it to the app domain.</description>
		<content:encoded><![CDATA[<p>If it&#8217;s just for getting the assembly version you could also use</p>
<p>[System.Reflection.AssemblyName]::GetAssemblyName(string file)</p>
<p>It opens, reads and closes the assembly to get the version information, but does not add it to the app domain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rennie</title>
		<link>http://elegantcode.com/2009/12/22/powershell-load-assembly-without-locking-file/comment-page-1/#comment-51781</link>
		<dc:creator>Rennie</dc:creator>
		<pubDate>Wed, 23 Dec 2009 08:21:28 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/12/22/powershell-load-assembly-without-locking-file/#comment-51781</guid>
		<description>I too once ran into the problem that .Net does not have an Unload assembly function. I ended up spawning a new process to do the load of the assembly and examine it, and then let that process die.

With your technique the assembly remains loaded, I assume. 

1. This can have storage implications - if you need to do this for hundreds or thousands of assemblies you&#039;ll run out of storage, right?

2. In a product build situation where you build an assembly and want to load it and examine the result, and then maybe rebuild it and re-load it, I&#039;m wondering what will happen the second time you try to load it and the previous copy is still loaded?

Thanks for the article.</description>
		<content:encoded><![CDATA[<p>I too once ran into the problem that .Net does not have an Unload assembly function. I ended up spawning a new process to do the load of the assembly and examine it, and then let that process die.</p>
<p>With your technique the assembly remains loaded, I assume. </p>
<p>1. This can have storage implications &#8211; if you need to do this for hundreds or thousands of assemblies you&#8217;ll run out of storage, right?</p>
<p>2. In a product build situation where you build an assembly and want to load it and examine the result, and then maybe rebuild it and re-load it, I&#8217;m wondering what will happen the second time you try to load it and the previous copy is still loaded?</p>
<p>Thanks for the article.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

