.NET Development
VB DLL not showing properties and methods in .net
Gravatar is a globally recognized avatar based on your email address. VB DLL not showing properties and methods in .net
  Craig Tucker
  All
  Jul 21, 2017 @ 09:20am

Hi Rick, I have a strange issue. I have a vb dll i2image.dll that I can access properties and methods in .net. However, on another machine we cannot access these same properties and methods but we CAN see them in the object browser! Do you know what is going on? We have registered the dll successfully. Thanks much, Craig

BAD

GOOD

Gravatar is a globally recognized avatar based on your email address. re: VB DLL not showing properties and methods in .net
  Rick Strahl
  Craig Tucker
  Jul 21, 2017 @ 11:16am

Different versions? You sure it's the same dll?

Also make sure you're using the same runtimes. Maybe .NET 4.0 vs. .NET 4.5 versions have different features?

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: VB DLL not showing properties and methods in .net
  Craig Tucker
  Rick Strahl
  Jul 21, 2017 @ 11:35am

Yes, we have verified that they are the same versions and .net runtime. Oddly enough, it shows properly in the object browser, but as soon as we reference it, it is totally whacked.

Gravatar is a globally recognized avatar based on your email address. re: VB DLL not showing properties and methods in .net
  Rick Strahl
  Craig Tucker
  Jul 22, 2017 @ 11:00am

I don't know then. My guess it's some sort of version conflict that's the only way to account for this. Different versions of .NET that are referencing the component, or different versions of the assembly. Perhaps you have a different version in the GAC and a different local version in the BIN folder?

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: VB DLL not showing properties and methods in .net
  Craig Tucker
  Rick Strahl
  Aug 16, 2017 @ 08:49am

Hi Rick, Here is how we were able to resolve the issue. Since this was a VB6 COM type library, we realized .net cannot work with type libraries directly, instead it needs an interop assembly that contains the description of interfaces, structs, etc that correspond to the same things in the type library.

All that said, we had to generate an interop assembly for the COM library. The way we achieved this is through the command line utility Type Library Importer (Tlbimp.exe). This converts the type definitions found within the COM type library into equivalent definitions in a common language runtime assembly.

After creating the new i2Image.Net.dll everything shows and works as expected. Thought I'd share.

https://docs.microsoft.com/en-us/dotnet/framework/interop/how-to-generate-primary-interop-assemblies-using-tlbimp-exe

© 1996-2017