Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

I just wanted to know that I have a program written in C# and three other programs written in Visual Basic. So can I compile all the programs separately, add them in C# and link the forms?

Regards
Aman Chaurasia

What I have tried:

I have not tried yet because I wanted to know if it is possible or not.
Posted
Updated 14-May-18 22:57pm
Comments
Richard MacCutchan 15-May-18 4:43am    
Why not try it, and see what happens?

1 solution

Yes, provided the apps are all written for .NET (i.e. the VB code is after V6.0).

.NET applications all produce .NET Assembly files, which contain intermediate code that can be accessed from any .NET language and used as if it was in the same language.
All you have to do is add the DLL or EXE assembly files as references to your C# project and you will have access to the VB forms as if they were written in C# orginaly.

Do note that not all EXE or DLL files are .NET assemblies: these extensions were also used for their Native code equivalents, which cannot be referenced at all but must be accessed via DLLImport, a much more complex approach.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900