I created a strongly signed assembly in Visual Studio 2008 against the .NET 3.5 environment (I also tried 2.0). I found the class as COM visible, and I can find this DLL in Visual Studio 6 Object Explorer for Visual Basic. I can create exe in VB6 and run exe directly from Windows Explorer, and everything works fine. However, when I try to run a VB6 project inside Visual Studio 6, the .net assembly does not want to load and does not work with the following error:
ActiveX component can't create object
I also get this error instead of the above, depending on how I register the dll:
-2147024894 File or assembly name (myComponentName), or one of its dependencies, was not found.
Or that:
-2146233082 Automation error
I tried everything I could think of. It seems like this will be a problem with how VS6 works in debug mode. Perhaps the environment is different from the missing path to a particular dll. I have this problem on two different development machines. I can also reference the COM.net DLL, which was built by another developer using an older version of visual studio.net. I even opened the DLL with a dependent walker, and I did not get any obvious errors.
UPDATE:
The Proc monitor says that VB6 is looking for my dll in the vb6 studio home directory "C: \ Program Files \ Microsoft Visual Studio \ VB98 \ MyDLL.DLL" instead of where the DLL is registered. I placed the dll there and registered it, now I get a new error:
-2146234105 (80131107) "The format of the file 'MyDllName' is invalid."
, DLL , , ? ? , dll "C:\Program Files\Microsoft Visual Studio\VB98 \"
/:
, . , VB6.exe .net framework, (2.0 3.5). "C:\Program Files\Microsoft Visual Studio\VB98\vb6.exe.config", :
<configuration>
<startup>
<supportedRuntime version="v1.1.4322" />
</startup>
, dll visual studio 6. , .