How to use C# class in VB.NET project in windows application?

后端 未结 4 1021
逝去的感伤
逝去的感伤 2020-12-20 15:18

I wanna use the C# code file in VB.Net project Which is windows based application. But that C# class is not using in VB.NET application. How Can I perform this task.

4条回答
  •  眼角桃花
    2020-12-20 15:28

    It is very simple to combine your VB.net & C#.net project.

    Step1- Add projects which you wanna combine to a single solution.

    Step2- Within any one project VB/C# in which you want to call classes from other language project "Goto- Add Reference- Projects" and select the other project which will be automatically displayed.

    Step3- After adding the reference just add "Imports (in VB)" or "using (in C#)" statements to your code.

    Step4- bingooo!!! now you can use your VB/C# classes in another language.

    (tip: You can go only in one direction here i.e. either you can use your C# classes in VB.net or vice versa.)

    All the best

提交回复
热议问题