I have a VB6 App that uses a .Net component (via a .tlb reference in the VB6 app) which is working fine when executed as a compiled app, but it produces an error from the VB6 IDE a certain point when it is trying to use the .NET component.
I should note that the error occurs when the .NET component is meant to be invoking a third party reporting component. The error is specific to the reporting component. Something about not being able to cast from String to some other type.
The .tlb is in the same location as the application executable so I don't why there should be a problem. There is a .config for one of the DLLs but it only specifies where the log file should be.
I need to have the application running in the IDE in order to debug and step through the code. What could the problem be? Could the VB6 IDE be looking in a different location for certain DLLs?
This could be due to a runtime version mismatch. Try the following:
Create a .config file for the IDE (e.g. the EXE name of the IDE executable + .config).
Paste the following in it:
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
<requiredRuntime version="v2.0.50727" safemode="true"/>
</startup>
</configuration>
This will ensure that the .NET 2 runtime is loaded, no matter in which order .NET COM components are activated (some of which may be loaded by the IDE, causing a runtime mismatch in the process).