<?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>Sample Managed GAC API Wrappers </title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx</link><description>//------------------------------------------------------------- // GACWrap.cs // // This implements managed wrappers to GAC API Interfaces //------------------------------------------------------------- using System; using System.Runtime.InteropServices;</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Sample Managed GAC API Wrappers </title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#229932</link><pubDate>Wed, 15 Sep 2004 14:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:229932</guid><dc:creator>David Levine</dc:creator><description>Thanks for the wrappers. I've been playing around with them and have a couple of questions.&lt;br&gt;&lt;br&gt;1. Is there a list of HRESULT error codes that the GAC APIs might return? It would be helpful for displaying meaningful error displays.&lt;br&gt;&lt;br&gt;2. Is there an interface for enumerating the trace references? I think this might be useful for utilities trying to detect corrupted systems (references that are no longer valid).&lt;br&gt;&lt;br&gt;3. How is the AssemblyCommitFlags flag used when installing assemblies and the value is set to Force? &lt;br&gt;&lt;br&gt;4. When uninstalling an assembly what happens when a simple or partial name is used instead of the full name?  For example, if the name used is &amp;quot;foobar&amp;quot; without specifying a version, culture, etc., will it attempt to uninstall all versions of foobar? Can it uninstall sets of assemblies (e.g. all instances of a particular culture for a given assembly?)&lt;br&gt;&lt;br&gt;5. Can you provide a definition of the assembly Flags in the AssemblyInfo struct, and perhaps for the AssemblyCacheFlags and CreateAssemblyNameObjectFlags? &lt;br&gt;&lt;br&gt;I know this is a lot - any additional you can provide is appreciated. Thanks.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>re: Sample Managed GAC API Wrappers </title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#230077</link><pubDate>Wed, 15 Sep 2004 19:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:230077</guid><dc:creator>Junfeng Zhang</dc:creator><description>1. Alan described the error codes here&lt;br&gt;&lt;a target="_new" href="http://blogs.gotdotnet.com/alanshi/commentview.aspx/18d8429f-ac4f-421b-9e5c-d0fdad0d6b9f"&gt;http://blogs.gotdotnet.com/alanshi/commentview.aspx/18d8429f-ac4f-421b-9e5c-d0fdad0d6b9f&lt;/a&gt;&lt;br&gt;&lt;br&gt;2. There are interfaces for enumerating trace references. I don't think many people are interested in it, so I did not include it. &lt;br&gt;&lt;br&gt;3. The force behavior is discussed here:&lt;br&gt;&lt;a target="_new" href="http://blogs.msdn.com/junfeng/archive/2004/02/14/72666.aspx"&gt;http://blogs.msdn.com/junfeng/archive/2004/02/14/72666.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;4. Uninstall takes a fully specified name. The behavior for partial name uninstall is undefined. &lt;br&gt;&lt;br&gt;5. Those flags are not really useful. I never see people use them. So I exclude them for more clarify. </description></item><item><title>re: Sample Managed GAC API Wrappers </title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#230379</link><pubDate>Thu, 16 Sep 2004 13:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:230379</guid><dc:creator>JLops</dc:creator><description>Thanks for the wrapper and the examples, they helped alot!&lt;br&gt;I tried this code in a ClickOnce deployed app with &amp;quot;Full Trust&amp;quot; and it worked fine.  I always thought ClickOnce deployed apps couldn't touch the GAC?  Is this some way around that?  If so, is it a bug?</description></item><item><title>re: Sample Managed GAC API Wrappers </title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#230505</link><pubDate>Thu, 16 Sep 2004 17:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:230505</guid><dc:creator>Junfeng Zhang</dc:creator><description>ClickOnce app is all driven by permission. If you are admin on the machine, and ClickOnce app has full trust, it should do can install/uninstall assembly like normal applications. </description></item><item><title>re: Sample Managed GAC API Wrappers </title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#230510</link><pubDate>Thu, 16 Sep 2004 17:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:230510</guid><dc:creator>Junfeng Zhang</dc:creator><description>I just realize there is an absolute need to enumerate trace reference as well, for migration purpose. I'll update the wrapper later to include that. </description></item><item><title>re: Sample Managed GAC API Wrappers </title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#230589</link><pubDate>Thu, 16 Sep 2004 19:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:230589</guid><dc:creator>David Levine</dc:creator><description>I followed the link to the KB article and I added support for the trace reference to the wrapper code. Thanks for the info - it helped a lot. I can forward the modified file if you like.&lt;br&gt;&lt;br&gt;...I had a couple of remaining questions...&lt;br&gt;&lt;br&gt;The AssemblyCommitEnum defines two enumerated fields, Default = 0, and Force = 1. The KB article calls out ASSEMBLYCACHE_INSTALL_FLAG_REFRESH = 1 and xxx_FORCE_REFRESH = 2. To force the install should a value of 1 or 2 be used? &lt;br&gt;&lt;br&gt;&lt;br&gt;When enumerating the ZAP cache the AssemblyName object obtained from GetNextAssembly appears to support building the display string differently then the GAC cache objects. It appears to always omit the processor architecture portion of the display name. &lt;br&gt;&lt;br&gt;This creates problems later when I try to pass that string to AssemblyCache::QueryAssemblyInfo - it fails it if it does not contain the processor. Also, if I leave off the version info as well as the processor info then it starts working again. Any idea of what I might be doing wrong here?&lt;br&gt;&lt;br&gt;Everything else works as expected. Thanks&lt;br&gt;</description></item><item><title>re: Sample Managed GAC API Wrappers </title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#230595</link><pubDate>Thu, 16 Sep 2004 20:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:230595</guid><dc:creator>Junfeng Zhang</dc:creator><description>David, &lt;br&gt;&lt;br&gt;Please forward it to me, via the contact link. Saves some time for me:)&lt;br&gt;&lt;br&gt;I have to look at the FORCE install with care. It is likely there is a bug in my managed wrapper. &lt;br&gt;&lt;br&gt;The managed wrapper is intended for GAC only. It does not work with ZAP cache. &lt;br&gt;&lt;br&gt;AssemblyCache::QueryAssemblyInfo does not work with ZAP at all. &lt;br&gt;&lt;br&gt;I will explain the PA problem later. </description></item><item><title>re: Sample Managed GAC API Wrappers </title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#236211</link><pubDate>Thu, 30 Sep 2004 16:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:236211</guid><dc:creator>David Levine</dc:creator><description>Thanks for clarifying some issues; one about the PA part of the name, and the other about the proper value for FORCE versus REFRESH. Everything else was pretty much what I expected.&lt;br&gt;&lt;br&gt;I noticed you added a value for an OsInstallGuid guid...I assume this is a means of identifying an assembly installed into the GAC by the OS. &lt;br&gt;</description></item><item><title>re: Sample Managed GAC API Wrappers </title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#236257</link><pubDate>Thu, 30 Sep 2004 18:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:236257</guid><dc:creator>Junfeng Zhang</dc:creator><description>I added it for display purpose. Yes, this one can only used by OS during OS setup. Today only Windows Server 2003 setup uses it. </description></item><item><title>re: Sample Managed GAC API Wrappers </title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#236461</link><pubDate>Fri, 01 Oct 2004 03:03:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:236461</guid><dc:creator>Flier Lu</dc:creator><description>Here is a sample program, maby more complete &lt;br&gt;&lt;br&gt;&lt;a target="_new" href="http://flier.5i4k.net/GacUtilW.rar"&gt;http://flier.5i4k.net/GacUtilW.rar&lt;/a&gt;&lt;br&gt;&lt;br&gt;and some articles in Chinese &lt;br&gt;&lt;br&gt;&lt;a target="_new" href="http://www.blogcn.com/User8/flier_lu/index.html?id=3765092"&gt;http://www.blogcn.com/User8/flier_lu/index.html?id=3765092&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a target="_new" href="http://www.blogcn.com/User8/flier_lu/index.html?id=4046367"&gt;http://www.blogcn.com/User8/flier_lu/index.html?id=4046367&lt;/a&gt;&lt;br&gt;&lt;br&gt;I wish these maybe useful. :D&lt;br&gt;&lt;br&gt;Thanks Zhang :P</description></item><item><title>re: Sample Managed GAC API Wrappers </title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#236495</link><pubDate>Fri, 01 Oct 2004 04:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:236495</guid><dc:creator>Junfeng Zhang</dc:creator><description>Flier,&lt;br&gt;&lt;br&gt;Your sample is based on v1.1's fusion, and it lacks of ProcessorArchitecture. Fusion.h is already in v2.0 beta1. But the documentation is behind. &lt;br&gt;&lt;br&gt;Also we already have an AssemblyName class in System.Reflection namespace. You probably don't want to introduce a new one. </description></item><item><title>Enumerating the assemblies in the GAC.</title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#462688</link><pubDate>Fri, 09 Sep 2005 03:47:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:462688</guid><dc:creator>Yves Dolce</dc:creator><description>&amp;amp;amp;nbsp;&lt;br&gt;This is a version that fulfill my needs but if you need filtering, the information required is...</description></item><item><title>Enumerating the assemblies in the GAC.</title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#462693</link><pubDate>Fri, 09 Sep 2005 03:54:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:462693</guid><dc:creator>Yves Dolce</dc:creator><description>&amp;amp;amp;nbsp;&lt;br&gt;This is a version that fulfills my needs but if you need filtering, the information required...</description></item><item><title>Enumerating the assemblies in the GAC.</title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#462696</link><pubDate>Fri, 09 Sep 2005 03:55:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:462696</guid><dc:creator>Yves Dolce</dc:creator><description>&amp;amp;amp;nbsp;&lt;br&gt;This is a version that fulfills my needs but if you need filtering, the information required...</description></item><item><title>ProcessorArchitecture and Assembly.FullName</title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#462708</link><pubDate>Fri, 09 Sep 2005 04:21:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:462708</guid><dc:creator>Junfeng Zhang's .Net Framework Notes</dc:creator><description>If you haven’t noticed, assemblies in .Net framework 2.0 have a new name attribute ProcessorArchitecture....</description></item><item><title>Enumerating the assemblies in the GAC.</title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#463301</link><pubDate>Sat, 10 Sep 2005 06:53:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:463301</guid><dc:creator>Yves Dolce</dc:creator><description>&amp;amp;amp;nbsp;&lt;br&gt;This is a version that fulfills my needs but if you need filtering, the information required...</description></item><item><title>ProcessorArchitecture and Assembly.FullName</title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#464846</link><pubDate>Tue, 13 Sep 2005 19:45:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:464846</guid><dc:creator>Junfeng Zhang's .Net Framework Notes</dc:creator><description>If you haven’t noticed, assemblies in .Net framework 2.0 have a new name attribute ProcessorArchitecture....</description></item><item><title>GacUtil</title><link>http://blogs.msdn.com/junfeng/pages/229649.aspx#530850</link><pubDate>Mon, 13 Feb 2006 14:47:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:530850</guid><dc:creator>PSfD: Team Blog</dc:creator><description>Recently a number of people have been asking about deploying assemblies into the GAC (Global Assembly...</description></item></channel></rss>