<?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>Junfeng Zhang's Windows Programming Notes : Fusion</title><link>http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx</link><description>Tags: Fusion</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Internal Manifest vs External Manifest</title><link>http://blogs.msdn.com/junfeng/archive/2009/05/11/internal-manifest-vs-external-manifest.aspx</link><pubDate>Mon, 11 May 2009 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9590632</guid><dc:creator>junfeng</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/9590632.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=9590632</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=9590632</wfw:comment><description>&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Internal manifest is the RT_MANIFEST resource in the executable.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;External manifest is App.exe.manifest.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;In Windows XP, Sxs searches external manifest before internal manifest. If an external manifest is found, the internal manifest is ignored.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;In Windows Server 2003 and later, the order is reversed. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;Internal manifest is preferred over external manifest. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;If you use external manifest, and your scenario works in Windows XP, but not Windows Server 2003 and later, please double check the executable does not have an internal manifest&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9590632" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category></item><item><title>App Config’s root element should be namespace-less</title><link>http://blogs.msdn.com/junfeng/archive/2008/03/24/app-config-s-root-element-should-be-namespace-less.aspx</link><pubDate>Mon, 24 Mar 2008 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8332461</guid><dc:creator>junfeng</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/8332461.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=8332461</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=8332461</wfw:comment><description>&lt;p&gt;The root element for Application config file is &amp;lt;configuration&amp;gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;i&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; ?&amp;gt;        &lt;br /&gt;&amp;lt;configuration&lt;b&gt; &lt;/b&gt;&amp;gt;         &lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;/i&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The application config file is shared with CLR and Windows SxS. &lt;/p&gt;  &lt;p&gt;SxS dictates that the &lt;b&gt;root element is &amp;lt;configuration&amp;gt;, and it should be without namespace&lt;/b&gt;. If the application config file does not follow the rule, SxS will refuse to start the process. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8332461" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/.NetFramework/default.aspx">.NetFramework</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category></item><item><title>Assembly Loading and Authorization</title><link>http://blogs.msdn.com/junfeng/archive/2007/11/12/assembly-loading-and-authorization.aspx</link><pubDate>Mon, 12 Nov 2007 19:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5828393</guid><dc:creator>junfeng</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/5828393.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=5828393</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=5828393</wfw:comment><description>&lt;P&gt;CLR does not do anything special regarding authorization during assembly loading. It will try to access the file under the current user. However, if an assembly is already loaded, next time when the assembly is requested, CLR will return the assembly from the cache without hitting the file. &lt;/P&gt;
&lt;P&gt;When the application impersonates a user, things get a little bit interesting. Sometimes the impersonated user does not have access to the assembly. Sometimes the impersonated user has read access to the assembly, but the appdomain has shadow copy enabled, and the impersonated user does not have write access to the shadow copy location. All those cases will result in access denied when the application tries to load the assembly. &lt;/P&gt;
&lt;P&gt;In most cases, this access deny is perfectly acceptable. However, in some cases, you may want the user to be able to use the assembly. For example, you developed a web application. You would like to run the web application under the user accessing the web application, but the user does not necessarily have the right to write to "Temporary ASP.NET files" location where ASP.NET stores the shadow copied assembly. &lt;/P&gt;
&lt;P&gt;You can workaround this problem by pre-loading the assemblies using a high privileged user. Since CLR does not touch the file after the assembly is loaded, you can sidestep the access deny problem. &lt;/P&gt;
&lt;P&gt;(This technique does not work for Assembly.LoadFrom/LoadFile, for obvious reason.)&lt;/P&gt;
&lt;P&gt;However, there is apparent security implications, and you have to evaluate it carefully. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5828393" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/.NetFramework/default.aspx">.NetFramework</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category></item><item><title>Windows Vista Sxs Activation Context Cache</title><link>http://blogs.msdn.com/junfeng/archive/2007/10/01/vista-activation-context-cache.aspx</link><pubDate>Mon, 01 Oct 2007 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4183798</guid><dc:creator>junfeng</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/4183798.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=4183798</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=4183798</wfw:comment><description>&lt;P&gt;Sxs activation model is built on top of Actication Context. To create an activation context, use the API CreateActCtx. 
&lt;P&gt;Activation Context is used very frequently in Windows. For example, a simple operation like start notepad, open the common file dialog, select a file, will call CreateActCtx many times (I measured 18 times in Vista). With the adoption of Sxs model in VC++ libraries, the usage of activation context will certainly be much higher. 
&lt;P&gt;However, creating an activation context is a very expensive operation. It has to resolve the full assembly binding closure, which includes probing for policies for all the assemblies, probing for each assembly, and parse each manifest. If you have read the output of sxstrace, you will certainly understand there are a lot work during CreateActCtx. 
&lt;P&gt;Fortunately, activation context is fairly static. Given a steady state, it is likely the same input to CreateActCtx will always create an activation context with exactly the same content. This makes it an attractively target for caching. 
&lt;P&gt;In Windows Vista, Sxs implements an activation context cache. The article discusses some detail of the Vista activation context cache. 
&lt;P&gt;&lt;STRONG&gt;1. What to cache&lt;/STRONG&gt; 
&lt;P&gt;Only applications from local disk are cached. For applications running&amp;nbsp;off network or CD, the cache has no effect. 
&lt;P&gt;&lt;STRONG&gt;2. Location of the cache&lt;/STRONG&gt; 
&lt;P&gt;From this article (&lt;A href="http://blogs.msdn.com/junfeng/archive/2007/06/12/activation-context-creation-flow.aspx" mce_href="http://blogs.msdn.com/junfeng/archive/2007/06/12/activation-context-creation-flow.aspx"&gt;http://blogs.msdn.com/junfeng/archive/2007/06/12/activation-context-creation-flow.aspx&lt;/A&gt;) , we understand that the real work of CreateActCtx is done in CSRSS.exe. And this is where the cache is. The main reason is so that the activation context can be shared with multiple processes. 
&lt;P&gt;Since each session has a copy of CSRSS.exe, the cache is not shared across use login sessions. 
&lt;P&gt;&lt;STRONG&gt;3. Life time of the cache&lt;/STRONG&gt; 
&lt;P&gt;The cache is only stored in memory. The first time CreateActCtx is called, it adds an entry to the cache. Next time when the same CreateActCtx is called, the result is returned from the cache immediately, saving the expensive probing and xml parsing. The cache is lost when the machine reboots. 
&lt;P&gt;&lt;STRONG&gt;4. size of the cache&lt;/STRONG&gt; 
&lt;P&gt;The cache in Vista RTM has a fixed size, with a Least Recently Used (LRU) replacement algorithm. This may change in the future. 
&lt;P&gt;&lt;STRONG&gt;5. Cache Key&lt;/STRONG&gt; 
&lt;P&gt;The activation context stores the parsed content of all manifests in the full assembly binding closure. Ideally, the cache key should be the path of all the manifests, and their last modified time. 
&lt;P&gt;However, if Sxs uses that as the key to the cache, it means Sxs will have to do all the expensive probing, parsing, which makes the cache useless. 
&lt;P&gt;To make a compromise, Sxs chooses the path of the entry manifest of CreateActCtx and its last modified time as the key. &lt;STRONG&gt;&lt;FONT color=#ff0000&gt;This means, if one of its dependent assemblies has changed, it is necessary to "touch" (i.e. change the last modified time of) the entry manifest for Sxs to see the change. &lt;/FONT&gt;&lt;/STRONG&gt;
&lt;P&gt;Here is an example. You may have a manifest myapp.exe.manifest depending on VC80, and you decides to deploy vc80 privately. So you have a private Microsoft.VC80.CRT.manifest. In Vista, when you change Microsoft.VC80.CRT.manifest, in order for Sxs to see the change in this manifest, you need to change the last modified time of myapp.exe.manifest. 
&lt;P&gt;&lt;STRONG&gt;5. WinSxs&lt;/STRONG&gt; 
&lt;P&gt;If the dependent manifests are part of the application, this update requirement is very reasonable. However, if the assembly you depend on is in the global WinSxs store, you may not get a chance to update your manifest when the assembly in Winsxs changes.&amp;nbsp; 
&lt;P&gt;Thus in Vista, Sxs adds a WinSxs store timestamp. Whenever a publisher policy assembly is installed to Winsxs store, Sxs updates the timestamp. The activation context cache saves the Winsxs store timestamp in the cache when the cache is created. When Sxs processes a CreateActCtx request, it checks to see if the cached Winsxs store timestamp matches the real Winsxs store timestamp. If it does not, Sxs throws out the cache, and re-creates it from scratch. 
&lt;P&gt;The reason that the timestamp is updated only when a publisher policy assembly is installed, is because Sxs requires a publisher policy when update an assembly in Winsxs store. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;6. Disable the SxS Cache&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Remember in the post &lt;A class="" title=DotLocal href="http://blogs.msdn.com/junfeng/archive/2006/01/24/517221.aspx" mce_href="http://blogs.msdn.com/junfeng/archive/2006/01/24/517221.aspx"&gt;DotLocal (.local) Dll Redirection&lt;/A&gt;, we know that for private testing, we can use registry &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT color=#0000ff&gt;HKLM\Software\Microsoft\WindowsNT\CurrentVersion\Image File Execution Options!DevOverrideEnable:REG_DWORD&lt;/FONT&gt;&lt;/I&gt;&lt;/B&gt; to enable DotLocal Dll redirection for applications with SxS manifest. Since disabling the SxS cache&amp;nbsp;should&amp;nbsp;be really for testing only, the same registry key is used to disable the SxS cache.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4183798" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Vista/default.aspx">Vista</category></item><item><title>The Unusual Ref/Def Mismatch FileLoadException</title><link>http://blogs.msdn.com/junfeng/archive/2007/08/06/the-unusual-ref-def-mismatch-fileloadexception.aspx</link><pubDate>Mon, 06 Aug 2007 18:00:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3758233</guid><dc:creator>junfeng</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/3758233.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=3758233</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=3758233</wfw:comment><description>&lt;p&gt;One of my colleagues has experienced a very strange Ref/Def Mismatch FileLoadException (The located assembly's manifest definition does not match the assembly reference). After a long investigation, we finally track down the cause. &lt;/p&gt; &lt;p&gt;To explain the problem, we have to understand &lt;a href="http://blogs.msdn.com/junfeng/archive/2007/08/06/the-sequence-of-interactions-between-clr-loader-and-fusion-during-assembly-load.aspx" target="_blank"&gt;the sequence of assembly loading and the interaction between fusion and CLR.&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The&amp;nbsp; key is after LoadLibrary , loader does one more check to make sure the file has not been changed between the original file mapping and LoadLibrary. &lt;/p&gt; &lt;p&gt;In my colleague's case, the assembly is in GAC. During the short period in between, someone did an in-place update of the assembly (When the assembly is mapped, you cannot delete it, but you can move it to a different location. This is how fusion does in-place update of assembly in GAC). Very unlucky indeed. &lt;/p&gt; &lt;p&gt;Since the file mapping is cached per-process, it is necessary to restart the process to load the assembly successfully again. &lt;/p&gt; &lt;p&gt;The bottom line is, CLR assembly loading does not work well against in-place update. Please avoid it if possible. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3758233" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/.NetFramework/default.aspx">.NetFramework</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category></item><item><title>The sequence of interactions between CLR loader and fusion during Assembly.Load</title><link>http://blogs.msdn.com/junfeng/archive/2007/08/06/the-sequence-of-interactions-between-clr-loader-and-fusion-during-assembly-load.aspx</link><pubDate>Mon, 06 Aug 2007 10:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3758123</guid><dc:creator>junfeng</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/3758123.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=3758123</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=3758123</wfw:comment><description>&lt;P&gt;The following describes roughly the sequence of interactions between CLR loader and fusion during Assembly.Load() in .Net framework 2.0.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;1. User calls Assembly.Load. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;2. Loader pass the assembly reference to fusion.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;3. Fusion checks to see if the assembly has already loaded. If it is, the assembly is returned.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;4. If not, fusion probes the assembly as described in MSDN. If fusion cannot find the assembly, it returns a failure. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;5. If fusion finds an assembly, it asks loader to crack the metadata of the assembly. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;6. Loader maps the assembly, usually using file mapping, and cracks the metadata of the assembly. Loader also stores the file mapping in a process wide cache. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;7. After fusion gets the metadata of the assembly, it does a ref-def matching. If the check fails, fusion returns error.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;8. Otherwise, fusion puts the assembly in a cache, and returns the assembly to loader.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;9. Loader does some additional checks. If the checks are good, Loader loads the assembly by calling LoadLibrary. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;10. After LoadLibrary, Loader does one more check to make sure the assembly did not change between the original file mapping and LoadLibrary. If the file has changed, Loader throws ref/def mismatch FileLoadException. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;11. If everything is good, Loader returns the assembly.&lt;/EM&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3758123" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/.NetFramework/default.aspx">.NetFramework</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category></item><item><title>64 bit gacutil.exe</title><link>http://blogs.msdn.com/junfeng/archive/2007/07/19/64-bit-gacutil-exe.aspx</link><pubDate>Thu, 19 Jul 2007 18:00:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3943380</guid><dc:creator>junfeng</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/3943380.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=3943380</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=3943380</wfw:comment><description>&lt;p&gt; 32 bit gacutil.exe can install/uninstall/enumerate 64 bit assemblies for GAC, so there is really no need for 64 bit gacutil.exe. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3943380" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/.NetFramework/default.aspx">.NetFramework</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category></item><item><title>BadImageFormatException maybe thrown when loading a valid assembly</title><link>http://blogs.msdn.com/junfeng/archive/2007/07/11/badimageformatexception-maybe-thrown-when-loading-a-valid-assembly.aspx</link><pubDate>Wed, 11 Jul 2007 18:00:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3800741</guid><dc:creator>junfeng</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/3800741.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=3800741</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=3800741</wfw:comment><description>&lt;p&gt;We saw some cases when loading a perfect valid assembly, CLR may throw BadImageFormatException occasionally. &lt;/p&gt; &lt;p&gt;In one particular case, we discover that it is caused by anti-virus scanners. Turn off the "Protection Against Unknown Threats" feature in the anti-virus engine and the problem disappears. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3800741" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/.NetFramework/default.aspx">.NetFramework</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category></item><item><title>RT_MANIFEST resource, and ISOLATION_AWARE_ENABLED</title><link>http://blogs.msdn.com/junfeng/archive/2007/06/26/rt-manifest-resource-and-isolation-aware-enabled.aspx</link><pubDate>Tue, 26 Jun 2007 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3494040</guid><dc:creator>junfeng</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/3494040.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=3494040</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=3494040</wfw:comment><description>&lt;H6&gt;&lt;FONT size=3&gt;RT_MANIFEST&lt;/FONT&gt;&lt;/H6&gt;
&lt;P&gt;Since Windows XP, Windows reserves a new type of resource RT_MANIFEST for SxS manifests. &lt;/P&gt;
&lt;P&gt;Within the RT_MANIFEST resource, Windows reserves ID 1-16. A binary cannot have two IDs of resource type RT_MANIFEST within 1-16. Windows will refuse to load such binary in Windows XP/Windows Server 2003. &lt;/P&gt;
&lt;P&gt;Only three IDs are used today in Windows. &lt;/P&gt;
&lt;P&gt;excerpt from Winuser.h&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT color=#0000ff&gt;#define RT_MANIFEST&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MAKEINTRESOURCE(24)&lt;BR&gt;#define CREATEPROCESS_MANIFEST_RESOURCE_ID MAKEINTRESOURCE( 1)&lt;BR&gt;#define ISOLATIONAWARE_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(2)&lt;BR&gt;#define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(3)&lt;BR&gt;#define MINIMUM_RESERVED_MANIFEST_RESOURCE_ID MAKEINTRESOURCE( 1 /*inclusive*/)&lt;BR&gt;#define MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(16 /*inclusive*/)&lt;/FONT&gt; &lt;/EM&gt;
&lt;H6&gt;&lt;FONT size=3&gt;CREATEPROCESS_MANIFEST_RESOURCE_ID&lt;/FONT&gt;&lt;/H6&gt;
&lt;P&gt;CREATEPROCESS_MANIFEST_RESOURCE_ID is used primarily for EXEs. If an executable has a resource of type RT_MANIFEST, ID CREATEPROCESS_MANIFEST_RESOURCE_ID, Windows will create a process default activation context for the process. The process default activation context will be used by all components running in the process. &lt;/P&gt;
&lt;P&gt;CREATEPROCESS_MANIFEST_RESOURCE_ID can also used by DLLs. When Windows probe for dependencies, if the dll has a resource of type RT_MANIFEST, ID CREATEPROCESS_MANIFEST_RESOURCE_ID, Windows will use that manifest as the dependency. &lt;/P&gt;
&lt;H6&gt;&lt;STRONG&gt;&lt;FONT size=3&gt;ISOLATIONAWARE_MANIFEST_RESOURCE_ID&lt;/FONT&gt;&lt;/STRONG&gt; &lt;/H6&gt;
&lt;P&gt;ISOLATIONAWARE_MANIFEST_RESOURCE_ID is used primarily for DLLs. It should be used if the dll wants private dependencies other than the process default. For example, if an dll depends on comctl32.dll version 6.0.0.0. It should have a resource of type RT_MANIFEST, ID ISOLATIONAWARE_MANIFEST_RESOURCE_ID to depend on comctl32.dll version 6.0.0.0, so that even if the process executable wants comctl32.dll version 5.1, the dll itself will still use the right version of comctl32.dll. &lt;/P&gt;
&lt;P&gt;When LoadLibrary is called, before loading the dependencies of the dll, the NT library loader checks to see if the dll has a resource of type RT_MANIFEST, ID ISOLATIONAWARE_MANIFEST_RESOURCE_ID. If it does, the loader calls CreateActCtx with the resource, and use the generated activation context to probe the dll's static dependencies. This is reason why the dll can have private dependencies with the ISOLATIONAWARE_MANIFEST_RESOURCE_ID resource. &lt;/P&gt;
&lt;P&gt;The activation context created during LoadLibrary is stored in the loader data structure tracking the dll. &lt;/P&gt;
&lt;P&gt;Normally this activation context is used only during LoadLibrary, for the dll's static dependencies. &lt;/P&gt;
&lt;P&gt;Sometimes, you want to use the activation context outside of probing the dll's static dependencies. You can define macro ISOLATION_AWARE_ENABLED when you compile the module. &lt;/P&gt;
&lt;H6&gt;&lt;STRONG&gt;&lt;FONT size=3&gt;ISOLATION_AWARE_ENABLED&lt;/FONT&gt;&lt;/STRONG&gt; &lt;/H6&gt;
&lt;P&gt;When ISOLATION_AWARE_ENABLED is defined, Windows re-defines certain APIs. For example LoadLibraryExW is redefined to IsolationAwareLoadLibraryExW. &lt;/P&gt;
&lt;P&gt;When IsolationAwareLoadLibraryExW is first called, it tries to retrieve the activation context stored in the loader data structure when the calling library is loaded. If the library does not have such activation context (for example, the library does not have a manifest of id ISOLATIONAWARE_MANIFEST_RESOURCE_ID), IsolationAwareLoadLibraryExW tries to create a new activation context with the calling library with id ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID MAKEINTRESOURCE. If the creation fails, IsolationAwareLoadLibraryExW will use the process default activation context. &lt;/P&gt;
&lt;P&gt;Once the activation context is determined, IsolationAwareLoadLibraryExW will call ActivateActCtx on the activation context, call the real API (LoadLibraryExW), and on return, it calls DeactivationActCtx. This way, the correct activation context is automatically used. &lt;/P&gt;
&lt;P&gt;Not all APIs affected by activation context are wrapped. For example, GetModuleHandleEx is not wrapped, and neither is any of the COM APIs. For a complete list of APIs wrapped by ISOLATION_AWARE_ENABLED, check your copy of Windows SDK. &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT color=#0000ff&gt;C:\Program Files\Microsoft SDKs\Windows\v6.0\Include&amp;gt;dir *.inl&lt;BR&gt;Volume in drive C has no label.&lt;BR&gt;Volume Serial Number is ECD1-6DB0 &lt;/FONT&gt;&lt;/EM&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT color=#0000ff&gt;Directory of C:\Program Files\Microsoft SDKs\Windows\v6.0\Include &lt;/FONT&gt;&lt;/EM&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;&lt;EM&gt;10/30/2006&amp;nbsp; 01:44 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 159,222 commctrl.inl&lt;BR&gt;10/30/2006&amp;nbsp; 01:44 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 32,836 commdlg.inl&lt;BR&gt;10/30/2006&amp;nbsp; 01:44 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12,065 prsht.inl&lt;BR&gt;10/30/2006&amp;nbsp; 01:44 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 23,430 WinBase.Inl&lt;BR&gt;10/30/2006&amp;nbsp; 01:44 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 36,308 WinUser.Inl&lt;/EM&gt; &lt;/FONT&gt;
&lt;P&gt;If the APIs you use are not wrapped by ISOLATION_AWARE_ENABLED, you have to do the activation/deactivation yourself properly. You can use the C++ helper class described in MSDN &lt;A title=http://msdn2.microsoft.com/en-us/library/aa375197.aspx href="http://msdn2.microsoft.com/en-us/library/aa375197.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/aa375197.aspx"&gt;http://msdn2.microsoft.com/en-us/library/aa375197.aspx&lt;/A&gt;. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more information, please see MSDN section about Sxs &lt;A href="http://msdn2.microsoft.com/en-us/library/aa375193.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/aa375193.aspx"&gt;Isolated Applications and Side-by-side Assemblies&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3494040" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category></item><item><title>Diagnose SideBySide failures in Windows XP/Windows Server 2003</title><link>http://blogs.msdn.com/junfeng/archive/2007/06/12/diagnose-sidebyside-failures-in-windows-xp-windows-server-2003.aspx</link><pubDate>Tue, 12 Jun 2007 22:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3234999</guid><dc:creator>junfeng</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/3234999.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=3234999</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=3234999</wfw:comment><description>&lt;P&gt;&lt;FONT size=3&gt;Since I published my article on &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/junfeng/archive/2006/04/14/576314.aspx" mce_href="http://blogs.msdn.com/junfeng/archive/2006/04/14/576314.aspx"&gt;&lt;FONT size=3&gt;how to diagnose SideBySide failures&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt;, I have received many feedbacks that&amp;nbsp;since Sxstrace is not available in Windows XP/Windows Server 2003, it is hard to&amp;nbsp;figure out what is wrong in Windows XP/Windows Server 2003. &amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;This article&amp;nbsp;intends to help people diagnose SideBySide failures in Windows XP/Windows Server 2003. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;SideBySide failures usually results in error code Win32 error &lt;STRONG&gt;&lt;FONT color=#0000ff&gt;ERROR_SXS_CANT_GEN_ACTCTX&lt;/FONT&gt;&lt;/STRONG&gt; (or HRESULT 0x800736B1), or ntstatus code &lt;STRONG&gt;&lt;FONT color=#0000ff&gt;STATUS_SXS_CANT_GEN_ACTCTX&lt;/FONT&gt; &lt;/STRONG&gt;(0xc0150002). You may see it when launching a process with Sxs manifest, or loading a dll with sxs manifest. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;From this &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/junfeng/archive/2007/06/12/activation-context-creation-flow.aspx" mce_href="http://blogs.msdn.com/junfeng/archive/2007/06/12/activation-context-creation-flow.aspx"&gt;&lt;FONT size=3&gt;article&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt;, we learned that the real work is done by CSRSS.exe. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Since most of the work in Creating Activation Context is probing, we can use the sysinternals tool &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/technet/sysinternals/utilities/filemon.mspx" mce_href="http://www.microsoft.com/technet/sysinternals/utilities/filemon.mspx"&gt;&lt;FONT size=3&gt;FileMon.exe&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt; to understand what is going on. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Let's run an example. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;I am running on Windows Server 2003.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;F:\tools&amp;gt;ver &lt;/EM&gt;
&lt;P&gt;&lt;EM&gt;Microsoft Windows [Version 5.2.3790]&lt;/EM&gt; 
&lt;P&gt;&lt;FONT size=3&gt;There is&amp;nbsp;a tool CoCreate.exe. It has a Sxs manifest depends on common control.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;F:\tools&amp;gt;more cocreate.exe.manifest&lt;BR&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&lt;BR&gt;&amp;lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;assemblyIdentity&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="CoCreate"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; version="1.0.0.0"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /&amp;gt; &lt;/EM&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dependency&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dependentAssembly&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;assemblyIdentity&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type="win32"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="Microsoft.Windows.Common-Controls"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; version="6.1.0.0"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; processorArchitecture="*"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; publicKeyToken="6595b64144ccf1df"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; language="*"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/dependentAssembly&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/dependency&amp;gt; &lt;/EM&gt;
&lt;P&gt;&lt;EM&gt;&amp;lt;/assembly&amp;gt;&lt;/EM&gt; 
&lt;P&gt;&lt;FONT size=3&gt;Unfortunately it says it depends on common control version 6.1.0.0, which does not exist anywhere currently. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Let's run the tool anyway. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;F:\tools&amp;gt;cocreate&lt;BR&gt;The system cannot execute the specified program.&lt;/EM&gt; 
&lt;P&gt;&lt;FONT size=3&gt;Just as expected, the tool refuses to run. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Let's look at what event log tells us. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/junfeng/WindowsLiveWriter/DiagnoseSideBySidefailuresinWindowsXPWin_BC8A/sxsevent.jpg" mce_href="http://blogs.msdn.com/blogfiles/junfeng/WindowsLiveWriter/DiagnoseSideBySidefailuresinWindowsXPWin_BC8A/sxsevent.jpg" atomicselection="true"&gt;&lt;FONT size=3&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=448 alt=sxsevent src="http://blogs.msdn.com/blogfiles/junfeng/WindowsLiveWriter/DiagnoseSideBySidefailuresinWindowsXPWin_BC8A/sxsevent_thumb.jpg" width=405 border=0 mce_src="http://blogs.msdn.com/blogfiles/junfeng/WindowsLiveWriter/DiagnoseSideBySidefailuresinWindowsXPWin_BC8A/sxsevent_thumb.jpg"&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;The message is accurate. But it is not really helpful here. What referenced assembly is not installed on my system? &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Let's see if Filemon can help us here or not. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Launch filemon, and set the filter to CSRSS, as we want to monitor file access from the process CSRSS.exe. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Re-run CoCreate.exe. Now we have this in FileMon:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/junfeng/WindowsLiveWriter/DiagnoseSideBySidefailuresinWindowsXPWin_BC8A/csrss_1.jpg" mce_href="http://blogs.msdn.com/blogfiles/junfeng/WindowsLiveWriter/DiagnoseSideBySidefailuresinWindowsXPWin_BC8A/csrss_1.jpg" atomicselection="true"&gt;&lt;FONT size=3&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=860 alt=csrss src="http://blogs.msdn.com/blogfiles/junfeng/WindowsLiveWriter/DiagnoseSideBySidefailuresinWindowsXPWin_BC8A/csrss_thumb_1.jpg" width=1373 border=0 mce_src="http://blogs.msdn.com/blogfiles/junfeng/WindowsLiveWriter/DiagnoseSideBySidefailuresinWindowsXPWin_BC8A/csrss_thumb_1.jpg"&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Ok. CSRSS.exe did a lot probing for Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.1.0.0.xxx. Given that CoCreate.exe.manifest says it depends on common control version 6.1.0.0, it is pretty clear that the missing referenced assembly is common control version 6.1.0.0. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size=3&gt;&lt;FONT color=#ff0000&gt;Warning!!! Please do not attempt to copy files to the Winsxs directories shown in filemon output to workaround the Sxs activation context creation problem. Sxs keeps other metadata about the assembly besides the files in %windir%\Winsxs. Please always use the documented way to install Sxs assemblies.&lt;/FONT&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3234999" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category></item><item><title>Activation Context Creation flow</title><link>http://blogs.msdn.com/junfeng/archive/2007/06/12/activation-context-creation-flow.aspx</link><pubDate>Tue, 12 Jun 2007 18:00:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3234261</guid><dc:creator>junfeng</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/3234261.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=3234261</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=3234261</wfw:comment><description>&lt;p&gt;The following describes how activation context is created currently in Windows XP/Windows Server 2003/Windows Vista.&lt;/p&gt; &lt;p&gt;1. CreateProcess/CreateActCtx is called. &lt;/p&gt; &lt;p&gt;2. CreateProcess/CreateActCtx does some validation, constructs a message, sends the message to CSRSS.exe, and waits for CSRSS.exe to return.&lt;/p&gt; &lt;p&gt;3. CSRSS.exe receives the message, and creates the activation context as described in &lt;a title="http://blogs.msdn.com/junfeng/archive/2006/04/22/580482.aspx" href="http://blogs.msdn.com/junfeng/archive/2006/04/22/580482.aspx"&gt;http://blogs.msdn.com/junfeng/archive/2006/04/22/580482.aspx&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;4. Once the activation context is created, CSRSS returns it to the client. &lt;/p&gt; &lt;p&gt;5. CreateProcess/CreateActCtx proceeds. &lt;/p&gt; &lt;p&gt;The getaway from the flow above is: &lt;strong&gt;most work is done in CSRSS.exe.&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3234261" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category></item><item><title>Genman32 – A tool to generate Sxs manifest for managed assembly for Registration Free COM/.Net Interop</title><link>http://blogs.msdn.com/junfeng/archive/2007/04/14/genman32-a-tool-to-generate-sxs-manifest-for-managed-assembly-for-registration-free-com-net-interop.aspx</link><pubDate>Sat, 14 Apr 2007 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2111091</guid><dc:creator>junfeng</dc:creator><slash:comments>12</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/2111091.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=2111091</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=2111091</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Attached to this article is GenMan32, a tool to generate sxs manifest for managed assembly to use in registration free COM/.Net Interop scenario. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;(For more information about registration free COM/.Net interop, please read &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/junfeng/archive/2006/05/17/595140.aspx" mce_href="http://blogs.msdn.com/junfeng/archive/2006/05/17/595140.aspx"&gt;&lt;FONT face=Calibri size=3&gt;http://blogs.msdn.com/junfeng/archive/2006/05/17/595140.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt;.)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;GenMan32&amp;nbsp;uses reflection API to enumerate all the types in the assembly. For each type, if it requires registration (as determined by &lt;/FONT&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/system.runtime.interopservices.registrationservices.typerequiresregistration.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.runtime.interopservices.registrationservices.typerequiresregistration.aspx"&gt;&lt;FONT face=Calibri size=3&gt;System.Runtime.InteropServices.RegistrationServices.TypeRequiresRegistraton&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt;), depending on what kind of type it is, the tool generates either a clrClass element, or a clrSurrogate element. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;For most basic scenarios, the sxs manifest generated by the tool is sufficient. For more complex scenarios, we may have to edit the generated manifest file before add the manifest to the assembly. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Here is the usage of the tool.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;genman32&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Microsoft (R) .NET Framework Win32 Manifest File Generation Utility 2.0.60120.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Copyright (C) Microsoft Corporation 1998-2004.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;All rights reserved.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Syntax: GenMan32 AssemblyName [Options]&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Options:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/add&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Add manifest file to the assembly as a resource.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;If /manifest option is provided, use the filename a&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;s input.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Otherwise generate one from the assembly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/remove&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Remove an embedded manifest from the assembly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/replace&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Replace embedded manifest with new manifest.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;New manifest is specified by /manifest option.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/manifest:filename&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Specify the manifest file to add or replace.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Used together with option /add or /replace.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/typelib&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;Generate typelib and record all the interfaces in&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;manifest. This option cannot be used with interop&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;assemblies.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/reference:filename&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Specify the dependency of the assembly. To specify&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;multiple dependencies, specify the /reference optio&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;n multiple time.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/asmpath:directory&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Look for assembly references here.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/out:filename&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Generate manifest. If filename is omitted, the&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;manifest is generated as AssemblyName.manifest.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/nologo&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Prevents GenMan32 from displaying logo.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/silent&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Silent mode. Success messages not displayed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;/? or /help&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Display this usage message.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;We can use the tool to generate a Sxs manifest for managed assembly. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;more testlib.cs&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;using System;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;using System.Runtime.InteropServices;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;[ComVisible(true)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;public class TestClass&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public void TestAPI()&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;[ComVisible(true)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;public struct TestStruct&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;int testField;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;genman32 testlib.dll /out:1.man&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Microsoft (R) .NET Framework Win32 Manifest File Generation Utility 2.0.60120.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Copyright (C) Microsoft Corporation 1998-2004.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;All rights reserved.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Win32 Manifest file D:\tools\1.man is created successfully&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal; tab-stops: 54.75pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;Let’s look at the generated manifest. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;more 1.man&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;assemblyIdentity&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="testlib"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;version="0.0.0.0"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;processorArchitecture="MSIL" /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;clrClass&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;clsid="{ED653D53-DA9A-35A8-B16E-6C8704AC432D}"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;progid="TestClass"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;threadingModel="Both"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="TestClass"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;runtimeVersion="v2.0.50727"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/clrClass&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;clrSurrogate&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;clsid="{D250790F-F50A-33FD-990F-FF5DC3E26E9B}"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="TestStruct"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/clrSurrogate&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;file name="testlib.dll"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/file&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;/assembly&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;We can also use this tool to add the manifest to the managed assembly. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;genman32 testlib.dll /add /manifest:1.man&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Microsoft (R) .NET Framework Win32 Manifest File Generation Utility 2.0.60120.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Copyright (C) Microsoft Corporation 1998-2004.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;All rights reserved.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Win32 Manifest added to assembly 'D:\tools\testlib.dll' successfully&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;We can verify the manifest is indeed successfully embedded to the managed assembly. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;dumpmanifest -f testlib.dll 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;assemblyIdentity&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="testlib"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;version="0.0.0.0"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;processorArchitecture="MSIL" /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;clrClass&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;clsid="{ED653D53-DA9A-35A8-B16E-6C8704AC432D}"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;progid="TestClass"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;threadingModel="Both"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="TestClass"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;runtimeVersion="v2.0.50727"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/clrClass&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;clrSurrogate&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;clsid="{D250790F-F50A-33FD-990F-FF5DC3E26E9B}"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="TestStruct"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/clrSurrogate&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;file name="testlib.dll"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/file&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;/assembly&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;Let’s prove ourselves that this is indeed working. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;CoCreate.exe simply calls CoCreateInstance. If it fails, CoCreate.exe prints an error message, else it prints success. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;more cocreate.exe.manifest&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;assemblyIdentity&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="CoCreate"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;version="0.0.0.0"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;type="win32"/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;/assembly&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;cocreate {ED653D53-DA9A-35A8-B16E-6C8704AC432D}&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Error: CoCreateInstance({ED653D53-DA9A-35A8-B16E-6C8704AC432D}) failed with hr=&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;0x80040154.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;Let’s add TestLib to CoCreate.exe’s dependency. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;more cocreate.exe.manifest&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;assemblyIdentity&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="CoCreate"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;version="0.0.0.0"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;type="win32"/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;dependency&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;dependentAssembly&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;assemblyIdentity&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="testlib"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;version="0.0.0.0"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;processorArchitecture="MSIL" /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/dependentAssembly&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;/dependency&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;/assembly&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;cocreate {ED653D53-DA9A-35A8-B16E-6C8704AC432D}&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Success!&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;Good job!&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2111091" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/junfeng/attachment/2111091.ashx" length="15418" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/junfeng/archive/tags/.NetFramework/default.aspx">.NetFramework</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category></item><item><title>GAC Temp and Tmp</title><link>http://blogs.msdn.com/junfeng/archive/2006/11/17/gac-temp-and-tmp.aspx</link><pubDate>Fri, 17 Nov 2006 19:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1092125</guid><dc:creator>junfeng</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/1092125.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=1092125</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=1092125</wfw:comment><description>&lt;P&gt;I see people &lt;A href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=927456&amp;amp;SiteID=1" target=_blank mce_href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=927456&amp;amp;SiteID=1"&gt;asking question&lt;/A&gt; about the Temp and Tmp directories under GAC. &lt;/P&gt;
&lt;P&gt;Yes they are temporary directory fusion uses during GAC Assembly installation and uninstallation. &lt;FONT color=#0000cc&gt;Tmp is used for installation, and Temp is used for uninstallation. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The use of them is described in my article &lt;A href="http://blogs.msdn.com/junfeng/archive/2005/10/24/484063.aspx" mce_href="http://blogs.msdn.com/junfeng/archive/2005/10/24/484063.aspx"&gt;GAC Assemblies: Install and Uninstall&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;The reason that fusion needs two temporary folders, is that fusion will always try to clean up the Temp directory used for uninstallation at the end of each installation/uninstallation.&amp;nbsp;If fusion were to use the same temporary directory for installation and uninstallation, fusion may accidentally remove temporary files used by another assembly installation in progress. &lt;/P&gt;
&lt;P&gt;Fusion does not clean up Tmp directory (used for installation). When an installation failed, fusion tries to remove the temporary directory it created during the installation. It does not touch anything else, for the same reason above. &lt;/P&gt;
&lt;P&gt;Usually you should&amp;nbsp;not see anything in Tmp unless during assembly installation. You may see things under Temp. When fusion is asked to uninstall an assembly, if the assembly&amp;nbsp;is in use, fusion will be able to move the assembly to the Temp directory, but won't be able to delete it. That is OK though. Next time when get a chance, fusion will try to clean up that directory. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1092125" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category></item><item><title>Installing SxS assemblies in Vista</title><link>http://blogs.msdn.com/junfeng/archive/2006/11/09/installing-sxs-assemblies-in-vista.aspx</link><pubDate>Thu, 09 Nov 2006 19:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1043092</guid><dc:creator>junfeng</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/1043092.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=1043092</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=1043092</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;When installing SxS assemblies in Vista, you may experience &lt;SPAN style="COLOR: black; mso-themecolor: text1"&gt;MSI error 1935&lt;/SPAN&gt;, with &lt;SPAN style="COLOR: black; mso-themecolor: text1"&gt;HRESULT&lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #0070c0"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;0x80073715&lt;/SPAN&gt;&lt;/B&gt;. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;0x80073715 is Win32 error ERROR_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: black; mso-themecolor: text1"&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;//&lt;BR&gt;// MessageId: ERROR_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT&lt;BR&gt;//&lt;BR&gt;// MessageText:&lt;BR&gt;//&lt;BR&gt;// The identities of the manifests are identical but their contents are different.&lt;BR&gt;//&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: black; mso-themecolor: text1"&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;#define ERROR_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT 14101L&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: black; mso-themecolor: text1"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;This error means, you have tried to install two assemblies with the same identity but with different contents. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #0070c0"&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;To workaround the issue, whenever you change the content of the assembly, you need to change the version number of the assembly. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1043092" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Vista/default.aspx">Vista</category></item><item><title>Touch the exe, after you added a manifest for it, in Vista</title><link>http://blogs.msdn.com/junfeng/archive/2006/10/25/touch-the-exe-after-you-added-a-manifest-for-it-in-vista.aspx</link><pubDate>Wed, 25 Oct 2006 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:871518</guid><dc:creator>junfeng</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/871518.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=871518</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=871518</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;You are an enthusiastic and responsible developer. You love programming, and you love programming the right way. &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;So you get the latest and greatest Windows Vista. You try your hard-worked amazing.exe application in Vista. Did not work. Apparently, amazing.exe needs admin privilege to do wonderful things. But in Vista, the user by default does not have admin privilege. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;You did your research. You understand that you need to add a manifest to your application, and declare that the application requires administrator in the manifest. So you added amazing.exe.manifest, and put it next to amazing.exe. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;Did not work. Amazing.exe did not get admin privilege. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;You double checked the syntax of the manifest. Yes, it is right. You compared it to another working example. Yes, they are the same. You run amazing.exe again. Still did not work. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;You are angry. What is going on, Microsoft?&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #0070c0; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;The truth is, in Windows Vista, in order to improve CreateProcess performance, we cache the fact that an exe has manifest or not. The key to this cache, are the full path of the exe, and the last modified time of the exe file. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;After you execute the exe without manifest, when you add a manifest to the exe, in order for the OS to see the manifest, you need to change the last modified time of the exe (or simply say, &lt;/FONT&gt;&lt;A href="http://www.helge.mynetcologne.de/touch/index.htm"&gt;&lt;FONT face=Calibri&gt;touch&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri&gt; the exe), to invalidate the cache entry for the exe. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;The cache only exists in memory, and is never flushed to disk. On reboot the cache starts clean.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;At the time we did the work, our measurement shows that the cache improved CreateProcess performance by 10-15% in warm case, when the application does not have manifest. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: red; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;So remember, touch the exe, after you added a manifest for it, in Vista.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=871518" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Vista/default.aspx">Vista</category></item></channel></rss>