sam
sam

Reputation: 85

Add C# class library reference to VB.Net Project

I have a VB.Net Windows form application. I have added a C# class library to the solution that has VB.Net Windows form application. I compiled C# class library and have added reference to VB.Net windows form application. However when I am trying to add namespace of C# class library it just doesn't show up in the intellisense. Hence I was unable to access C# class and it's functions as well. Someone please tell me a fix for this. Thank you

Upvotes: 3

Views: 1904

Answers (1)

AmirReza-Farahlagha
AmirReza-Farahlagha

Reputation: 1212

Assuming the dll in question is CLS compliant and compiled against the same runtime version, you should be able to use it without a problem.

If either (or both) of these conditions are not met, you will not be able to use the imported DLL.

Make sure the Import directive uses the namespace as defined in the assembly metadata - look at your C# project properties to see what the default namespace is, that's what you need to import.

Upvotes: 5

Related Questions