Exception COM: 80040154, manifest already provided

I am developing my application using third party dll, it is a COM object. I am trying to make my application sandboxed using COM without registration. But I cannot find a good example / walk / tutorial on how to do all of this. Please tell me if I did the right thing?

I created a manifest for the original DLL, generated the type library using tlbimp.exe, added the type library as a project reference, instantiated the object normally. Even though I have already provided the manifest file, I still get this error:

System.Runtime.InteropServices.COMException was not handled
Message = Getting COM class factory for component with CLSID {7B3A2D19-1D82-4DF6-8939-B730058A5535} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 ( REGDB_E_CLASSNOTREG)).

Googled this and it seems like a lot of people are pointing out the build config, but I've already configured my build to use x86. I'm pretty sure the dll was also developed in an x86 environment. (I don't know if this is relevant or not ..)

I did:

  • Provide external manifest without deleting the internal RT_MANIFEST inside the dll.
  • Update RT_MANIFEST using mt.exe.
  • Use a type library generated by both of the above.

BTW, I'm also curious what FILEVERSION or PRODUCTVERSION number should I use for the version element inside the manifest? (I tried both, neither worked)

Properties showing FileVersion and ProductVersion

Please tell me where did I go wrong? Did I provide incorrect information for the manifest? How do I know what information I need for a manifest?

Please let me know if you need more information. Thanks everyone.

+3


source to share


1 answer


Probably because of this step:

Providing external manifest without removing the internal RT_MANIFEST inside the dll.



Starting in Windows Server 2003 with Service Pack 1 (SP1), Windows ignores the internal manifest if the file has an internal manifest. You can try the registry settings HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\PreferExternalManifest (DWORD) to 1

as mentioned in this blog and in KB article . This will make Windows look at the external manifest instead of the internal one.

However, if you are installing this on multiple systems, you will need to set this flag on all systems that you install. And this setting is a global setting affecting all applications, so it's probably not a good idea.

+1


source







All Articles