开发者

Using C# assemblies from VB6 code. Some issues

I have a C# assembly, which is regasmed, but is not in the GAC. In my VB6 code, I added a reference to the generated type library (the .tlb file).

Then I instantiate the C# lib in my VB6 code. If I run it from the VB6 IDE, it does not work. The Set in the code below:

Dim obj as MyCSharpNamespace.MyCSharpObject
Set obj = New MyCSharpNamespace.MyCSharpObject

causes this error:

Automation error 
The system cannot find the file specified

However, if I compile the VB6 project to an EXE and run it, it runs perfectly fine.

I should add 开发者_运维知识库that all the VB6 project files (e.g. forms, modules, etc...) are in the same folder as the C# DLL and TLB.

So why can't I run it from the IDE environment?


Use the /codebase switch when running regasm.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜