Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 728
sam Avatar asked Jun 12 '26 05:06

sam


1 Answers

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.

like image 67
AmirReza-Farahlagha Avatar answered Jun 13 '26 19:06

AmirReza-Farahlagha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!