Forum Discussion

JDHIntercede's avatar
JDHIntercede
Copper Contributor
Jun 24, 2022

Private SxS Components (registration-free COM)

My application has private SxS components that it includes with an Application Manifest. This manifest includes dependentAssembly nodes that refer to COM DLLs in the same folder that have embedded assembly manifests. This all works fine outside of MSIX, but fails with a standard SxS error when packaged (The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail). 

 

Looking at the goings-on in Procmon, I can see that it's the 'csrss.exe' Windows component that is performing the lookup for the dependencies, and since this lives outside the container and is not invoked by my app directly (it's always running in the background), it is looking in the real ProgramFilesX86 folder rather than the one in the VFS that actually contains the DLLs. 

 

Does anyone have any suggestions on what the best way to handle this would be? I've tried the PSF FileRedirectionFixup and DynamicLibraryFixup in PSF, which don't work - I suspect this is because csrss isn't something that is being created from my application, but rather is something running in Windows and handling SxS, and so it isn't being intercepted. The bitness doesn't always match either, so I don't think PSF could intercept it even if it wanted to (my app is x86 due to 3rd part native components, but csrss is x64 on an x64 system).

 

My only fallback is to munge the VREG such that the components are registered 'globally' rather than privately (which is fine for MSIX as it's scoped to the container), but that means I need to have different Application Manifest files depending on if I'm packaging MSI versus MSIX (I ship both) since the exe will be expecting SxS as-is. 

8 Replies

  • I can confirm that applications with private manifests under MSIX seem to fall victim to the error message you mention (but not always). There is nothing in the PSF to help with this issue today, even after devoting a lot of time fruitlessly debugging these situations.

    My normal procmon trace excludes the csrss process, so I hadn't noticed it's involvement. Perhaps that will prove important.
    • JDHIntercede's avatar
      JDHIntercede
      Copper Contributor
      If it helps, this is only an issue for my .NET COM components as the SxS stuff is pretty strict about the presence of assemblyIdentity in the manifest; the native components are perfectly happy being registered directly in the application manifest rather than via dependentAssembly with embedded assembly manifests, whereas the .NET stuff requires a manifest per component since it requires assemblyIdentity, which can only appear once in a manifest.

      I guess I will have to just update the CI pipeline to use different manifests for MSI versus MSIX, and register the offending components in the VREG for the latter (I've quickly proven this out by hand and it works fine for my case). Not ideal, but it works.
      • TIMOTHY_MANGAN's avatar
        TIMOTHY_MANGAN
        MVP

        JDHIntercede Sounds like the right approach.

         

        I'm running into this in trying to repackage existing MSIs into MSIX.  Can you describe how to tell if the manifest is for registration-free COM?  A sample manifest would go a long way to help me understand this.

Resources