Is it possible to add some VB class to an asp.net [C #] project?

I am using asp.net [C #] in a project. This is a great project involving classes. I need to add some VB class to achieve some calculations. Is it possible to call a VB class from C # code?

+3
source share
4 answers

I do not deny the fact mentioned in all other answers that we cannot mix languages ​​in one project. The best approach is to create a separate library and use it as a reference in your project. . It will be easier to implement and better suited in terms of maintainability.

ASP.NET . webapplciation App_Code , .

.

enter image description here

. # CSCode VB VBCode, .

enter image description here

, , .

enter image description here

+4

VB C# .

VB.NET, C# IL ( ), (DLL ) VB.NET, #.

+4
  • Add the VB.net Class library project to your C # solution.

  • Add all VB.net classes to this class library

  • Add a link to the VB.Net class library project from the C # project

+2
source

No - you cannot mix languages ​​in the SAME project - answer the question in your title.

what you can do is reference the VB assembly containing this class.

0
source

All Articles