Merge VB.NET and C#

  • Thread starter Thread starter tomas_nordlander
  • Start date Start date
T

tomas_nordlander

Hi,

I and a college are working on 2 projects, one in C# and one in Vb.NET,
and would like to connect the projects using VB.NET project as the main
GUI and let an search algorithm in C# do the heavy work.

We are both rather new .net programmers and would appreciate some
newbie help in letting VB code give instruction to C#.

We appreciate any constructed comments, direction, pitfalls.

Thank in advance,

Tomas : )

PS" we are not interested in a discussion on doing all programming in
one of the two languages or a discussion one versus the other"
 
The simple answer would be to compile the C# code into a dll and then
add it into your VB project.

Thanks,

Seth Rowe
 
Hi,

I and a college are working on 2 projects, one in C# and one in Vb.NET,
and would like to connect the projects using VB.NET project as the main
GUI and let an search algorithm in C# do the heavy work.

We are both rather new .net programmers and would appreciate some
newbie help in letting VB code give instruction to C#.

We appreciate any constructed comments, direction, pitfalls.

Yes as Seth says, create a C# project (a Class Library) and put your C#
classes into it. Then add a reference to the library from your VB.NET
project. You will of course have to ship the library .DLL too.
 
Like the others said, in your solution you can have two projects, one DLL C#
project, and the other a VB.NET WinForms application. Just add the reference
to the DLL project from your VB.NET project.

Just FYI, a lot of newbie .net programmers don't usually know that you will
not see any kind of performance difference in doing "heavy work" in C#, since
the same code in either language will product the same IL most of the time.
However, I do highly recommend, for your benefit, in learning the two main
..NET syntaxs' (C# and VB.NET). What you are doing is a good way to learn
them both. Trust me, I encourage the direction you are taking. I have
interviewed many candidates with "2 to 3 year .NET experience" and not know
what Intermediate Language is. Being fluent in both will make you that much
more valuable.

Good luck!
 
Back
Top