I have 2 projects, one built in VB.NET and another in C#.NET. I want to use certain functionality of VB.NET into C#.NET and hence I have added the dll file of VB.NET solution into C#.NET as a reference by browsing the dll from my system.
Say dll name for VB.NET is myData.dll
In my C#.NET project I am trying to declare it as a namespace i.e. “using myData;” and its giving me an error of “Type or namespace name could not be found”
Am I missing something??
A clue about how your VB.NET project is organized. There are some things that can go wrong and you obviously are not aware of them, so lets find out.
According to our information the dll is added as reference.
Ok, so that is the DLL and you reference it.
No, you do NOT declare "it as a namespace". You tell the compiler to also look in this namespace for classes. Now, you do NOT tell to compiler whether myData.dll actually contains the namespace
myData. This is a totally different thing. You can do withoutusing– if you prefix every class. Nothing in the using statement references a dll.It could be VB.NET has wrapped another namespace around and it is
myData.myData. No joke. It could also be you forgot to make the classes public.To find out: