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

后端 未结 4 1018
逝去的感伤
逝去的感伤 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:24

    Compile the C# class in it's own C# class library (DLL) and then in your VB project, add a reference to the C# DLL. You can then use the class in your VB project.

    If, however, you want to include the source code of the C# class in your VB project then you will have to convert the class from C# to VB. There are various methods of doing this, such as the online tool Convert C# to VB.NET

提交回复
热议问题