Visual Basic Development Bookmark and Share   
 Home > Visual Basic Interop and Upgrade > Problems with Reg-Free Com
 

Problems with Reg-Free Com

I am having some very strange errors when trying to use an isolated component.

I have a windows service that uses an interop vb6 dll. In VS2008 I set the vb6 dll to isolated. Visual Studio generates all the necessary manifests. Since my service does not directly reference the com dll, it generates service.exe.manifest that contains references to other assemblies that do reference the com component. When I go to run the service, it will only work if I register the DLL on the machine. That is obviously not what I want to happen. I am getting the "No such interface supported" just as if I hadn't registered the component. I can't use sxstrace.exe since I am on XP and server 2003.

I created a small testing application that referenced the isolated dll directly instead of through other assemblies. All I did was instantiate one of the classes, but this didn't fail as it did earlier with the services. I compared the manifests generated by my test app and the service I am working on. They are identical except for assembly name.

Does anyone know why this might be happening? Is there anyway to debug to find out what's happening. I don't want to have to register the component on the production server.

I've read all the forum posts and articles I could find. There's no errors in the event log regarding the side by side activation like I've been told there should be. Did I forget to install something? The production machine as .net framework 3.5.

Here is the manifest for the service

<?xmlversion="1.0"encoding="utf-8"?>
<assemblyxsi:schemaLocation="urn:schemas-microsoft-com:asm.v1assembly.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">
<assemblyIdentityname="Service.exe"version="1.0.0.0"type="win32"/>
<dependency>
<dependentAssemblyasmv2:dependencyType="install"asmv2:codebase="Native.ServiceLibrary.manifest"asmv2:size="1951">
<assemblyIdentityname="Native.ServiceLibrary"version="1.0.0.0"type="win32"/>
<hashxmlns="urn:schemas-microsoft-com:asm.v2">
<dsig:Transforms>
<dsig:TransformAlgorithm="urn:schemas-microsoft-com:HashTransforms.Identity"/>
</dsig:Transforms>
<dsig:DigestMethodAlgorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<dsig:DigestValue>9R6hxcgGtK3vOvbE5xBL/I+dCs8=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssemblyasmv2:dependencyType="install"asmv2:codebase="Native.BusinessObject.manifest"asmv2:size="8826">
<assemblyIdentityname="Native.BusinessObject"version="1.0.0.0"type="win32"/>
<hashxmlns="urn:schemas-microsoft-com:asm.v2">
<dsig:Transforms>
<dsig:TransformAlgorithm="urn:schemas-microsoft-com:HashTransforms.Identity"/>
</dsig:Transforms>
<dsig:DigestMethodAlgorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<dsig:DigestValue>IUjtYMgEeil/9uUl9Dy7KphlgDM=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssemblyasmv2:dependencyType="install"asmv2:codebase="Native.WebService.manifest"asmv2:size="1278">
<assemblyIdentityname="Native.WebService"version="1.0.0.0"type="win32"/>
<hashxmlns="urn:schemas-microsoft-com:asm.v2">
<dsig:Transforms>
<dsig:TransformAlgorithm="urn:schemas-microsoft-com:HashTransforms.Identity"/>
</dsig:Transforms>
<dsig:DigestMethodAlgorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<dsig:DigestValue>HjdAo0XQ1iOtzpDVk6XERI3D1Gg=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
</assembly>

And here is the manifest of the assembly that actually contains the reference of the COM component. This is IDENTICAL save assembly name to my little test app that worked

<?xmlversion="1.0"encoding="utf-8"?>
<assemblyxsi:schemaLocation="urn:schemas-microsoft-com:asm.v1assembly.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">
<assemblyIdentityname="Native.BusinessObject"version="1.0.0.0"type="win32"/>
<filename="vb6Component.dll"asmv2:size="9900032">
<hashxmlns="urn:schemas-microsoft-com:asm.v2">
<dsig:Transforms>
<dsig:TransformAlgorithm="urn:schemas-microsoft-com:HashTransforms.Identity"/>
</dsig:Transforms>
<dsig:DigestMethodAlgorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<dsig:DigestValue>ImxPXo252XIWm9uMe3jJTyWRKmQ=</dsig:DigestValue>
</hash>
<typelibtlbid="{4df18f65-5af1-40f0-b10b-45ac3d330567}"version="1.0"helpdir=""resourceid="0"flags="HASDISKIMAGE"/>
<comClassclsid="{4770821c-caee-4c4a-8234-6d43b2072c08}"tlbid="{4df18f65-5af1-40f0-b10b-45ac3d330567}"progid="class1"/>
<comClassclsid="{2e37ea2c-ee70-4698-a562-4ec7bf1f408c}"tlbid="{4df18f65-5af1-40f0-b10b-45ac3d330567}"progid="class2"/>
</file>
</assembly>

I have changed the name of the assemblies and removed some of the classes for brevity. And just for reference, the windows service calls the ServiceLibrary assembly which calls the WebService assembly which callse the BusinessObject assembly which calls the vb6 COM component. The WebService assembly is not actually a web service, it's just a regular .net assembly that was named poorly.

Thanks
  • Edited bychriscap9916 Wednesday, July 30, 2008 5:43 PMAdding more info
  •  
chriscap9916  Wednesday, July 30, 2008 5:38 PM
Anybody? Suggestions?
chriscap9916  Thursday, July 31, 2008 3:23 PM
Hi Chriscap9916,

We need to know how you setup windows service. How do you add the COM DLL to the setup project and create the setup project for the windows service? Could you check the installation folder to see whether the required files is copied to here?

Best regards,
Riquel

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Riquel_Dong  Monday, August 04, 2008 7:52 AM
The COM DLL is detected as a dependency. The strange thing is that it is detected twice. Once from the registered version of the component and the second time from one of my projects (the project that has the reg free com reference). I exclude the registry reference and have the other set to not register itself. I don't know why it detects the dll twice (in two different locations) if it's isolated. The interop wrapper libraries are including in the dependencies and deployed to the output folder. The Manifest files are also detected as dependencies and are all copied to the output folder upon install.

I am using a standard setup project that comes with VS2008 (not installshield or anything special). Once installed, the application fails to recognized the reg free com. If I register the dll in the install folder, everything works properly.
chriscap9916  Monday, August 04, 2008 3:39 PM
Hi Chriscap9916,

Could you check the installed folder for the windows service to see what files is installed there? Whether the COM DLL is copied to there.

Best regards,
Riquel
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Riquel_Dong  Wednesday, August 06, 2008 6:06 AM
Yes, the com dll is in the installation folder as well the manfiests.
chriscap9916  Wednesday, August 06, 2008 3:38 PM
Remove Size and Hash sections from your manifest and give it a shot.
LedZepp  Friday, November 20, 2009 8:24 PM

You can use google to search for other answers

Custom Search

More Threads

• Com Interop and List(of T)
• Calling other .NET forms from VB6 exposed form
• Can I use .net Dll into vb6.0
• Passing array from .NET to VB6
• Automation Error -2146233078
• Renderization delay problem
• Debugging .NET code and VB6 code
• Help! Tabbing through controls not working.
• tray icon, fixed length string
• DataLogging - ActiveX Errors on Vista, but not on XP, using VB6 upgraded to VS2008