Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding C# class to vb.net project

Status
Not open for further replies.

ksbrace

Programmer
May 13, 2000
501
0
0
US
Hello,
I was wondering if I could add a c# class to an existing vb.net project? Thanks

 
Have you read up on the common language runtime? If not, the bottom line is that yes, you can use c# classes with vb.net classes. In fact, you can use any .net language with any other .net language. I suppose there's more to the CLR than that, but that's what affects us programmers earning our daily bread.

In order to use two different .net languages together, you must compile them into their own assemblies. For instance, say you had these assemblies:

MySolution.ExtendedUI.vb //vb.net file
MySolution.ShoppingCart.cs //c# file

After Compiling...

MySolution.ExtendedUI.dll
MySolution.ShoppingCart.dll

At this point, your further programming doesn't really care what languages the assemblies are written in. You could use these assemblies with JScript.net if you wanted to. If you used ExtendedUI in Shoppingcard, no problems either.

If you're not familiar with compiling dll's, post and I'll try to find a link or something for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top