I’m not sure if what I am trying to do is possible, but surprisingly VS2008 seems to let me copy a .cs file directly into my VB.NET project. I then thought that I may be able to use the class in this file directly from VB.NET. However, it doesn’t see it when I try to reference it in. Is what I'm trying to do possible, or is VS2008 simply treating the C# file as a resource file or something?
You should reference CS project that contains your class written in C# from your VB project. This class should be public. After doing it, you will be able to use this class in your VB project.
You'll need to add a C# project to the solution, rather than just copying the source file. Just create a new project making sure you select it as a C# class library or similar and make sure you add it to the current solution and then copy the source file into that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With