<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Assembly.Load() followed by Assembly.LoadFrom()?</title><link>http://blogs.msdn.com/b/junfeng/archive/2005/07/01/434580.aspx</link><description>Assembly.Load() takes an assembly display name as input, while Assembly.LoadFrom() takes a file path as input. 
 
 Typically the application will only call one of them, but not one after the other. 
 
 I have seen a few cases where people want to</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>Instanciation dynamique d'instance de type par chaine de caract?re | hilpers</title><link>http://blogs.msdn.com/b/junfeng/archive/2005/07/01/434580.aspx#9368796</link><pubDate>Thu, 22 Jan 2009 19:08:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9368796</guid><dc:creator>Instanciation dynamique d'instance de type par chaine de caract?re | hilpers</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.hilpers.fr/932532-instanciation-dynamique-dinstance-de-type"&gt;http://www.hilpers.fr/932532-instanciation-dynamique-dinstance-de-type&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9368796" width="1" height="1"&gt;</description></item><item><title>re: Assembly.Load() followed by Assembly.LoadFrom()?</title><link>http://blogs.msdn.com/b/junfeng/archive/2005/07/01/434580.aspx#444656</link><pubDate>Fri, 29 Jul 2005 00:41:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:444656</guid><dc:creator>Leon</dc:creator><description>Thank you for the book. I haven't seen that title before.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=444656" width="1" height="1"&gt;</description></item><item><title>re: Assembly.Load() followed by Assembly.LoadFrom()?</title><link>http://blogs.msdn.com/b/junfeng/archive/2005/07/01/434580.aspx#444654</link><pubDate>Fri, 29 Jul 2005 00:37:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:444654</guid><dc:creator>Junfeng Zhang</dc:creator><description>It could be some mistake in your code. I can't really tell from this thread so far. &lt;br&gt;&lt;br&gt;It could be a bug in CLR but this is very unlikely. Otherwise SQL folks will be chasing my back every minutes:)&lt;br&gt;&lt;br&gt;Please report it in MSDN feedback center. &lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=444654" width="1" height="1"&gt;</description></item><item><title>re: Assembly.Load() followed by Assembly.LoadFrom()?</title><link>http://blogs.msdn.com/b/junfeng/archive/2005/07/01/434580.aspx#444645</link><pubDate>Fri, 29 Jul 2005 00:23:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:444645</guid><dc:creator>Leon</dc:creator><description>I saw from the docs:&lt;br&gt;&lt;br&gt;&amp;quot;Remarks&lt;br&gt;The common language runtime resolves references using the following set of guidelines.&lt;br&gt;&lt;br&gt;First, it consults the list of assembly references returned by GetNonHostStoreAssemblies.&lt;br&gt;&lt;br&gt;If the assembly appears in the list, the runtime binds to it normally.&lt;br&gt;&lt;br&gt;If the assembly does not appear in the list, and the host has provided an implementation of IHostAssemblyStore, the runtime calls IHostAssemblyStore::ProvideAssembly to allow the host to supply the assembly to bind to.&lt;br&gt;&lt;br&gt;Otherwise, the runtime fails to bind the assembly.&lt;br&gt;&lt;br&gt;If the host sets ppReferenceList to NULL, the runtime first probes the Global Assembly Cache, then calls ProvideAssembly, then probes the application base, to resolve an assembly reference.&lt;br&gt;&lt;br&gt;Note: The runtime calls GetNonHostStoreAssemblies only once, upon initialization. It is not called again.&amp;quot;&lt;br&gt;&lt;br&gt;But I don't see loader consulting list of assembly references returned by GetNonHostStoreAssemblies for assembly specified in ExecuteInDefaultAppDomain. But it is consulted when I return ppReferenceList = NULL; from GetNonHostStoreAssemblies. So, I'm just trying to find out if this a bug or not.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=444645" width="1" height="1"&gt;</description></item><item><title>re: Assembly.Load() followed by Assembly.LoadFrom()?</title><link>http://blogs.msdn.com/b/junfeng/archive/2005/07/01/434580.aspx#444640</link><pubDate>Fri, 29 Jul 2005 00:20:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:444640</guid><dc:creator>Leon</dc:creator><description>But what I'm seeing is that ICLRAssemblyReferenceList is not consulted for the assembly specified in ExecuteInDefaultAppDomain when I return valid ICLRAssemblyReferenceList pointer from GetNonHostStoreAssemblies. And is consulted when I return null for ICLRAssemblyReferenceList pointer. This is on Beta 2.&lt;br&gt;&lt;br&gt;It will be time consuming to create a repro sample for this if it's not a bug, but standard behavior. Otherwise I could report it.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=444640" width="1" height="1"&gt;</description></item><item><title>re: Assembly.Load() followed by Assembly.LoadFrom()?</title><link>http://blogs.msdn.com/b/junfeng/archive/2005/07/01/434580.aspx#444631</link><pubDate>Thu, 28 Jul 2005 23:59:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:444631</guid><dc:creator>Junfeng Zhang</dc:creator><description>We call IHostAssemblyStore::ProvideAssembly when the assembly is *not* in the list of GetNonHostStoreAssemblies. &lt;br&gt;&lt;br&gt;When GetNonHostStoreAssemblies returns NULL, we probe GAC, then IHostAssemblyStore, finally appbase. &lt;br&gt;&lt;br&gt;There is a Matrix our test team uses. I'll see if I can still find it. &lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=444631" width="1" height="1"&gt;</description></item><item><title>re: Assembly.Load() followed by Assembly.LoadFrom()?</title><link>http://blogs.msdn.com/b/junfeng/archive/2005/07/01/434580.aspx#444625</link><pubDate>Thu, 28 Jul 2005 23:47:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:444625</guid><dc:creator>Leon</dc:creator><description>Thank you for the book recomendation. I will buy it. I'm pretty familiar with how it works in .NET 1.1. I hope the book covers new hosting API/AssemblyStore and my question.&lt;br&gt;&lt;br&gt;But briefly could you please just say if what I'm seeing is normal?&lt;br&gt;&lt;br&gt;Assembly specified in ExecuteInDefaultAppDomain doesn't go through IHostAssemblyStore::ProvideAssembly when I return my own ICLRAssemblyReferenceList implementation. And does go through IHostAssemblyStore::ProvideAssembly when I don't return ICLRAssemblyReferenceList implementation in GetNonHostStoreAssemblies.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=444625" width="1" height="1"&gt;</description></item><item><title>re: Assembly.Load() followed by Assembly.LoadFrom()?</title><link>http://blogs.msdn.com/b/junfeng/archive/2005/07/01/434580.aspx#444619</link><pubDate>Thu, 28 Jul 2005 23:28:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:444619</guid><dc:creator>Junfeng Zhang</dc:creator><description>You need to read Steven's book on this&lt;br&gt;&lt;br&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/junfeng/archive/2005/06/17/430342.aspx"&gt;http://blogs.msdn.com/junfeng/archive/2005/06/17/430342.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;It is a big topic. &lt;br&gt;&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=444619" width="1" height="1"&gt;</description></item><item><title>re: Assembly.Load() followed by Assembly.LoadFrom()?</title><link>http://blogs.msdn.com/b/junfeng/archive/2005/07/01/434580.aspx#444612</link><pubDate>Thu, 28 Jul 2005 23:17:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:444612</guid><dc:creator>Leon</dc:creator><description>Thank you for the comments.&lt;br&gt;&lt;br&gt;Would you mind answering CLR hosting and assembly binding relatedt questions?&lt;br&gt;&lt;br&gt;I'm trying new CLR 2.0 hosting API.&lt;br&gt;&lt;br&gt;1. I've provided IHostAssemblyManager impl to CLR.&lt;br&gt;2. I'm calling ExecuteInDefaultAppDomain(assemblyPath,...)&lt;br&gt;&lt;br&gt;Now the questions is:&lt;br&gt;&lt;br&gt;Why when I implement GetNonHostStoreAssemblies and return ICLRAssemblyReferenceList implementation, ExecuteInDefaultAppDomain fails to find the assembly. But if I set *ppReferenceList = NULL; in GetNonHostStoreAssemblies, it calls IHostAssemblyStore::ProvideAssembly.&lt;br&gt;&lt;br&gt;Neither IHostAssemblyStore::ProvideAssembly/ICLRAssemblyReferenceList::IsAssemblyReferenceInList/LRAssemblyReferenceList::IsStringAssemblyReferenceInList are called when it fails for ExecuteInDefaultAppDomain. But they are called for example when CLR needs to find my custom AppDomainManager. Is this a bug or standard behavior for ExecuteInDefaultAppDomain?&lt;br&gt;&lt;br&gt;Thanks a lot!&lt;br&gt; &lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=444612" width="1" height="1"&gt;</description></item><item><title>re: Assembly.Load() followed by Assembly.LoadFrom()?</title><link>http://blogs.msdn.com/b/junfeng/archive/2005/07/01/434580.aspx#444488</link><pubDate>Thu, 28 Jul 2005 19:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:444488</guid><dc:creator>Junfeng Zhang</dc:creator><description>1. No it will not be shared. &lt;br&gt;&lt;br&gt;2. IHostAssemblyStore does not provide any advantage here. It is meant for SQLServer type of storage where the assembly physically exists in a database as bytes. &lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=444488" width="1" height="1"&gt;</description></item></channel></rss>