VB6应用程序+ .NET组件工作已编译的应用程序,但不是在VB6 IDE [英] VB6 App + .Net component working as compiled app but not in VB6 IDE
问题描述
我有一个VB6应用程序,使用.NET组件(通过在VB6应用程序中的.TLB参考)时,作为编译应用程序中执行,这是工作的罚款,但会产生错误,从VB6 IDE中的某一点时,试图使用.NET组件。
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.
我要指出,当.NET组件,就是要调用第三方报告组件发生错误。
I should note that the error occurs when the .NET component is meant to be invoking a third party reporting component.
还有什么问题呢?请问VB6 IDE是在寻找一个不同的位置,某些DLL的?该.TLB是作为应用程序的可执行文件,所以我不为什么应该有一个问题,同一个位置。
What could the problem be? Could the VB6 IDE be looking in a different location for certain DLLs? The .tlb is in the same location as the application executable so I don't why there should be a problem.
我需要在IDE中运行的应用程序,以便调试,并通过code步骤。
I need to have the application running in the IDE in order to debug and step through the code.
推荐答案
这可能是由于运行时版本不匹配。请尝试以下操作:
This could be due to a runtime version mismatch. Try the following:
创建了一个IDE config文件(如IDE可执行+的.config的EXE名称)。
Create a .config file for the IDE (e.g. the EXE name of the IDE executable + .config).
在它粘贴以下:
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
<requiredRuntime version="v2.0.50727" safemode="true"/>
</startup>
</configuration>
这将确保.NET 2运行时被加载,无论以何种顺序.NET COM组件被激活(其中的一些可以由IDE加载,造成运行时间不匹配的过程中)。
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).
这篇关于VB6应用程序+ .NET组件工作已编译的应用程序,但不是在VB6 IDE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!