VBCorLib icon indicating copy to clipboard operation
VBCorLib copied to clipboard

The type library importer encountered an error during type verification. Try importing without class members

Open rrs opened this issue 3 years ago • 5 comments

I'm submitting a bug report

Library Version: 3.2.0

Please tell us about your environment:

Operating System: Windows [10]

Current behavior: When I add a com reference to VB.Ext in Visual Studio 2019 I get the error "error MSB3303: Could not resolve COM reference "e67787fd-71d6-4c37-837d-0300a1e31b5a" version 3.1. The type library importer encountered an error during type verification. Try importing without class members."

note: the version 3.1

If I run TBLImp on the dll directly it gives

"warning MSB3305: Processing COM reference "VBA" from path "C:\Windows\SysWOW64\msvbvm60.dll". Type library importer has encountered an interface not derived from IUnknown: '_HiddenInterface'."

Expected/desired behavior:

Add the com reference to .net projects so i can share the objects across the com boundary

p.s. Really amazing project, can't praise your work here enough!

rrs avatar Jun 23 '21 22:06 rrs

Hey, any guidance with this? Maybe its not possible to include it in .Net?

rrs avatar Aug 16 '21 08:08 rrs

Seems you can gen the interop dll manually and ignore the warning and can add that to a .Net project. I had a copy of the dll in SysWow64 but can't remember if i put it there or the installer. Where does the installer install VBCorLib3.dll? If you have tlbimp in the available toolchain where you build it would be great to add this as a step and maybe put the interop dll in the program files folder.

rrs avatar Aug 16 '21 09:08 rrs

Hello,

This was never built with .NET in mind. I'm unsure why you would want to include it in a .NET project. .NET provides the same functionality since VBCorLib is just a type of re-implementation of many of the .NET classes.

kellyethridge avatar Aug 16 '21 10:08 kellyethridge

It's useful for the com boundary. We have a large scale application written in vb6. The upgrade path is to add new features using WPF in .Net and slowly transition some of the core screens over to .Net. Being able to pass things like ArrayList over the com boundary is really useful, obviously it is not interchangeable with the .Net versions of the classes, but the data can just be mapped between the native version and yours.

rrs avatar Aug 16 '21 11:08 rrs

p.s. From your overview "This allows for easy data sharing between a .NET application and VB6.". I interpreted this to mean that it would work in .Net, and it does, its just that the Visual Studio wrapper around tlbimp surfaces the underlying warning as an error and there doesn't seem to be a way around this. Generating the Interop.VBCorLib3.dll manually works and you can just ignore the error.

I think the warning is coming from the VB collection type, probably as a return type or argument on one of the public methods, you can only instantiate it within the vb6 runtime and so it complains about that.

rrs avatar Aug 16 '21 16:08 rrs