The .NET languages interoperate with each other; that is, code of one language can be used from another after getting converted to IL. To test this create a new project in VB.Net with a template Class Library and name it vbproject.By default the project comes with a class class1.Write the following code in itPublic Class Class1 Public Function Add(ByVal x As Integer, ByVal y As Integer) As Integer Return x + y End Function Public Sub Hello(ByVal name As String) Console.WriteLine("Hello" & name) End Sub End ClassAs we can't execute the class we need to only compile it & convert it into an assembly. To do this open the solution explorer and right click on the project.Select Build to build your projectConsuming the Class from C# programing-Now create a new project in C#; name it Testvb and add a reference for the vb project assembly from its physical location which is in projects bin\Debug folders.To add a reference follow following steps-
C# Corner. All contents are copyright of their authors.