Combining C# and VB.net

  • Thread starter Thread starter Philip Townsend
  • Start date Start date
P

Philip Townsend

I have a web application written in vb.net, but work primarily in a C#
shop. I know that components written in C# can be included in vb apps
but have never explored it. Are there any good resources available
and/or suggestions, warnings, etc.? Thanks!
 
Philip Townsend said:
I have a web application written in vb.net, but work primarily in a C#
shop. I know that components written in C# can be included in vb apps
but have never explored it. Are there any good resources available
and/or suggestions, warnings, etc.? Thanks!

Basically you just use an assembly written in C# as you would any other
assembly - after it's compiled, it makes no real difference what it was
written in. You currently can't mix languages in one assembly (in
VS.NET - you can from the command line, if you really want to) but the
usual method is to just use an assembly written in one language in an
assembly in another one.
 
Dilip Krishnan said:
Keeping in mind however that the C# application is CLS compliant :)

What exactly do you mean? Do you mean that the C# assembly has to be
CLS compliant in order to be used by VB.NET? If so, I'm not sure how
true that is - can't the CLS-compliant parts of a non-CLS-compliant
assembly be used by VB.NET? (Consider that BitConverter has various
non-CLS-compliant methods which deal with unsigned types, for
instance.)
 
Back
Top