Junfeng Zhang's Musing

things about the world, world of things

Browse by Tags

Tagged Content List
  • Blog Post: Internal Manifest vs External Manifest

    Internal manifest is the RT_MANIFEST resource in the executable. External manifest is App.exe.manifest. In Windows XP, Sxs searches external manifest before internal manifest. If an external manifest is found, the internal manifest is ignored. In Windows Server 2003 and later, the order is reversed...
  • Blog Post: App Config’s root element should be namespace-less

    The root element for Application config file is <configuration> <?xml version="1.0" encoding="utf-8" ?> <configuration > </configuration> The application config file is shared with CLR and Windows SxS. SxS dictates that the root element is <configuration>...
  • Blog Post: Assembly Loading and Authorization

    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. When the...
  • Blog Post: Windows Vista Sxs Activation Context Cache

    Sxs activation model is built on top of Actication Context. To create an activation context, use the API CreateActCtx. 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...
  • Blog Post: The Unusual Ref/Def Mismatch FileLoadException

    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. To explain the problem, we have to understand the sequence of assembly...
  • Blog Post: The sequence of interactions between CLR loader and fusion during Assembly.Load

    The following describes roughly the sequence of interactions between CLR loader and fusion during Assembly.Load() in .Net framework 2.0. 1. User calls Assembly.Load. 2. Loader pass the assembly reference to fusion. 3. Fusion checks to see if the assembly has already loaded. If it is, the assembly...
  • Blog Post: 64 bit gacutil.exe

    32 bit gacutil.exe can install/uninstall/enumerate 64 bit assemblies for GAC, so there is really no need for 64 bit gacutil.exe.
  • Blog Post: BadImageFormatException maybe thrown when loading a valid assembly

    We saw some cases when loading a perfect valid assembly, CLR may throw BadImageFormatException occasionally. 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.
  • Blog Post: RT_MANIFEST resource, and ISOLATION_AWARE_ENABLED

    RT_MANIFEST Since Windows XP, Windows reserves a new type of resource RT_MANIFEST for SxS manifests. 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...
  • Blog Post: Diagnose SideBySide failures in Windows XP/Windows Server 2003

    Since I published my article on how to diagnose SideBySide failures , I have received many feedbacks that since Sxstrace is not available in Windows XP/Windows Server 2003, it is hard to figure out what is wrong in Windows XP/Windows Server 2003. This article intends to help people diagnose SideBySide...
  • Blog Post: Activation Context Creation flow

    The following describes how activation context is created currently in Windows XP/Windows Server 2003/Windows Vista. 1. CreateProcess/CreateActCtx is called. 2. CreateProcess/CreateActCtx does some validation, constructs a message, sends the message to CSRSS.exe, and waits for CSRSS.exe to return. 3...
  • Blog Post: Genman32 – A tool to generate Sxs manifest for managed assembly for Registration Free COM/.Net Interop

    Attached to this article is GenMan32, a tool to generate sxs manifest for managed assembly to use in registration free COM/.Net Interop scenario. (For more information about registration free COM/.Net interop, please read http://blogs.msdn.com/junfeng/archive/2006/05/17/595140.aspx .) GenMan32...
  • Blog Post: GAC Temp and Tmp

    I see people asking question about the Temp and Tmp directories under GAC. Yes they are temporary directory fusion uses during GAC Assembly installation and uninstallation. Tmp is used for installation, and Temp is used for uninstallation. The use of them is described in my article GAC Assemblies...
  • Blog Post: Installing SxS assemblies in Vista

    When installing SxS assemblies in Vista, you may experience MSI error 1935 , with HRESULT 0x80073715 . 0x80073715 is Win32 error ERROR_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT. // // MessageId: ERROR_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT // // MessageText: // // The identities...
  • Blog Post: Touch the exe, after you added a manifest for it, in Vista

    You are an enthusiastic and responsible developer. You love programming, and you love programming the right way. 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...
  • Blog Post: Windows XP may reboot when encounter certain manifest files

    If you are developing applications for Windows Vista using Visual Studio 2005, and you are adding Vista UAC manifest to your application, when your application runs on Windows XP with Service Pack 2 or Windows Server 2003 RTM (without SP1), Windows may reboot unexpectly. This is due to a bug in Sxs.dll...
  • Blog Post: Application config file is not used if the application has certain SxS manifest

    We discovered a bug internally. Since people may encounter the same problem, I am posting the bug description and the workaround. In Windows Server 2003, if the application has the following SxS manifest, then CLR will not use the application config file even if it exists. <?xml version...
  • Blog Post: Assembly.GlobalAssemblyCache Property

    Once you have an assembly loaded, you can use Assembly.GlobalAssemblyCache Property to determine if the assembly is loaded from GAC or not. I am surprised that not many people know about this property.
  • Blog Post: Registration Free COM/.Net interop

    In my last article , I briefly discussed how COM, Sxs and CLR work together to make registration free COM/.Net interop possible. Today, I want to dive a bit deeper into this feature. Specifically, I want to discuss 1. How activation works end to end. 2. How to generate manifests for managed assemblies...
  • Blog Post: Sxs --- Activation Context, Binding, Policy and Probing

    Sxs’ runtime behavior is built on top of the concept of Activation Context. (For more details on Activation Context, please visit MSDN . I have published an article on it early.) You can use API CreateActCtx to create an activation context. CreateActCtx requires a source manifest. Optionally, you...
  • Blog Post: COM activation, Registration Free COM activation, COM/.Net Interop, Registration Free COM/.Net Interop

    COM is easily one of the most commonly used technologies in Microsoft Windows Platform. Many of Microsoft Windows’ capabilities are only exposed in COM. I do not claim to be a COM expert. But my work in Microsoft in the past and now do affect how people use COM in some way. In this article, I want...
  • Blog Post: Multi-path on DEVPATH v2.0 QFE is available

    See http://support.microsoft.com/default.aspx?scid=kb;en-us;915430&sd=rss&spid=8291 for more detail. The other problem reported by Isaac http://blogs.msdn.com/junfeng/archive/2005/12/13/503059.aspx#546000 [b] If you add the section <runtime> <developmentMode developerInstallation...
  • Blog Post: Diagnosing SideBySide failures

    PhilW believes that SxS COM with manifest is one of those “well kept secrets” that should be more well known. As the current maintainer of Windows SxS, I am absolutely thrilled to hear that. That said, I have to admit that it is not the easiest thing in the world when something went wrong in Sxs...
  • Blog Post: Override CLR Assembly Probing Logic --- IHostAssemblyManager/IHostAssemblyStore

    In .Net framework when resolve an assembly reference, CLR first checks GAC, then search the application directory in specific locations. ( http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconhowruntimelocatesassemblies.asp ). If the assembly is not in one of those locations...
  • Blog Post: SXS Activation Context --- Activate and Deactivate

    In Windows XP the Side-by-Side technology is officially introduced: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sbscs/setup/isolated_applications_and_side_by_side_assemblies_start_page.asp In a nutshell, applications/components write data to a special XML file called Sxs Manifest...
Page 1 of 5 (125 items) 12345