Use the VB library created by VB Net in C #

Sometimes we come across some VB.net code that is not supported in C #, such as Mid, AscW, Asc, Right, Left .. etc. so I created Libraries created by VBnet. well my question is simple

is there a problem? if I develop 2 languages ​​NET?

+4
source share
5 answers

Both of these .net languages ​​(everything that seems to me) are compiled into the CLI . An intermediate language between machine code and C # / VB.NET.

When you reference a managed DLL, it doesn't matter what the source language is, the resulting DLL is the same. In fact, many reflectors (which show a representation of the source code of a managed DLL) have the ability to choose the language of the source code.

Therefore, you can refer to any managed DLL created from any .net language, using it in any (other) .net language.


If you only create a library using VB.NET because of features such as Mid , Left , Right , etc., you can just learn the C # equivalents or just copy them to C #.

0
source

You can import .net libraries into any other .net project. No problem.

+1
source
+1
source

No problems. Just add a link to Microsoft.VisualBasic and use the functions in C # code. More discussion of the pros and cons in this matter

+1
source

All .net languages ​​can be used with each other - there should be no problems. But I would check the VB.net code for "mid", etc. VERY carefully, these are old obsolete VB 6 style features - there is a huge change that the programmer has not changed in his programming program as necessary.

0
source

All Articles