how can I use a VB.NET file in C#?
I have a VB.NET class, I added it to a C# project and I tried to make an instance of that class in C#.....
I'm getting this error: "The type or namespace name 'Resizer' could not be found (are you missing a using directive or an assembly reference?)"
Rezier is the name of my VB class and this is my code:
Resizer a;
I dont even know if this is possible or not :D I just gave it a try....so is it possible? if so, what am I doing wrong?
Runtime OK - Dev not sure
Hi,
The IL - Intermediate Language... call it byte code ;) - is definitely interchangeable. I'm not sure this is true for the source code in projects.
What certainly should work (didn't do it yet myself):
- write your VB.Net Class (.vb file)
- compile the assembly
- switch to the C# project
- add the VB assembly to the references of your C# project
- import (or use) the namespace -- not shure this is necessary
- you should now be able to declare a type variable with the VB class and instanciate it
I'll let you know if this works.