7

So I have a registration free VB6 DLL referenced by my .NET 3.5 assembly library that's ultimately referenced by a .NET 3.5 WinForms application (not sure it's relevant, but included to paint a picture).

I am getting the error 'Problem isolating COM reference 'SomeVBDll': Registry key 'HKEY_CURRENT_USER\SOFTWARE\CLASSES\CLSID\{dd1d7f58-1d6b-4370-a1b9-05c03816a128}\InProcServer32' is missing value '(Default)'

My initial attempt was to check if this value actually existed and then put it into place. This resulted in the same above message on compilation.

Has anyone encountered this problem and know of any resolution to it?

Thanks in advance. Below is the manifest from the assembly that directly references the VB6 dll.

    <assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <assemblyIdentity name="Native.App.Core" version="1.0.0.0" type="win32" />
  <file name="SomeVBDll.dll" asmv2:size="184320">
    <hash xmlns="urn:schemas-microsoft-com:asm.v2">
      <dsig:Transforms>
        <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
      </dsig:Transforms>
      <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
      <dsig:DigestValue>BWWHQTqNGUupT8xznLoN3jn7S9Y=</dsig:DigestValue>
    </hash>
    <typelib tlbid="{755c1df5-d0c5-4e10-a93d-54bf186e8daf}" version="1.0" helpdir="" resourceid="0" flags="HASDISKIMAGE" />
    <comClass clsid="{dd1d7f58-1d6b-4370-a1b9-05c03816a128}" threadingModel="Apartment" tlbid="{755c1df5-d0c5-4e10-a93d-54bf186e8daf}" progid="SomeVBDll.MyClass" />
  </file>
</assembly>

EDIT///

Marking all of the classes within the VB6 DLL as MultiUse seems to have resolved the problem. While this gets around the problem I was experiencing and still allows me to use reg-free COM, does anyone know a way to get around having to set all of the COM classes Instancing to MultiUse?

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Wil P
  • 3,341
  • 1
  • 20
  • 20
  • This thread [http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.framework.interop/2006-01/msg00097.html] indicates the problem could be related to the fact that there are some classes within the VB6 dll that have instancing marked as private. This is also the case for me, I have one MultiUse (non-private) class and the rest are private. I would rather not mark the others as MultiUse, but I will do so to see if in fact that works around the problem.... – Wil P Oct 15 '09 at 20:30
  • Ok, so the MultiUse thing seems to be only a temporary fix and was not the actual underlying problem. I am now getting the same issue as mentioned in my original post. I am running as a Non-Admin on Windows Vista Ultimate x64 buildingt the project in Visual Studio 2008 as a Non-Admin. – Wil P Oct 22 '09 at 22:53
  • It seems to be reporting the error described above for every single class defined in the COM DLL. I have verified that each class is marked as MultiUse. – Wil P Oct 23 '09 at 15:35
  • Just for future readers - I think this other question which has a similar error message is the result of a different problem: https://stackoverflow.com/questions/8914138/registration-free-com-errors-with-exe – StayOnTarget Jun 28 '17 at 17:17

2 Answers2

0

The only solution I've seen proposed (if you want to avoid the possible security/maintenance issues of marking all classes as MultiUse) is to delete the ".../InProcServer32" registry key, but that workaround comes with the standard "be careful messing with the registry" caveat.

Noah Heldman
  • 6,724
  • 3
  • 40
  • 40
  • Even deleting the /InProcServer32 keys as part of the build process does not address the issue for me. I would be ok if I could make that work, but even when i delete those keys i still receive the errors. – Wil P Oct 29 '09 at 20:48
0

When marked as private VB6 COM classes do not register a value for Inproc32 and the assembly manifest generated by Visual Studio is incomplete. There are some tools like Make my Manifest http://mmm4vb6.atom5.com/ that can help you create a manifest for your components

CriGoT
  • 994
  • 7
  • 12
  • So even though I have marked every type in my VB6 dll MultiUse you think I still may have a manifest problem? I'll take a look the MMM when I get time to see if this helps. Thanks for posting. – Wil P Nov 01 '09 at 19:15