Raminder
Raminder

Reputation: 1887

Why same dll exposes different classes in C# and .net

I am using a third party .Net dll in my code and when I add a reference to this dll from a VB.Net application it shows different classes in intellisense and object browser than when I use it in a C# project. Why is there this difference?

Edit

If designer intended it that way I'd like to know how to do it in my own dlls.

Upvotes: 1

Views: 244

Answers (3)

JaredPar
JaredPar

Reputation: 754665

One thing to remember here is that intellisense is an approximation of what's allowed and legal in the program. It's goal is to be very close to true but often isn't. There are several reasons why a particular type may or may not show up in intellisense but does in C#

  • One of the 2 projects may be friends with the target assembly
  • Intellisense filters may exist on the documentation files which hide them from intellisense
  • Attribute filters on the type
  • Certain classes may get hidden due to case only differences in the name

Given that it also doesn't show up in the object browser, my guess is that the class has either intellisense or attribute filters that cause it to be hidden for VB.Net.

Upvotes: 0

John Saunders
John Saunders

Reputation: 161773

VB.NET provides the option to "hide advanced members". Perhaps it's the "advanced" members you're not seeing.

Upvotes: 1

John Kraft
John Kraft

Reputation: 6840

Without knowing the specifics, it is hard to say. Some possibilities that come to mind are:

  • The designer made it that way on purpose
  • Parts of the library are not CLR compliant, and therefore not visible by languages other than the one it was written in.

Upvotes: 3

Related Questions