C# and VB.NET

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ·½®¶«L

    C# and VB.NET

    How can I call a VB.NET function form C#?


  • Sean Wolfe

    #2
    Re: C# and VB.NET

    "·½®¶«L" <s015972@mailse rv.cuhk.edu.hk> wrote in message
    news:bnsg37$c9c $1@justice.itsc .cuhk.edu.hk...[color=blue]
    > How can I call a VB.NET function form C#?[/color]

    One of the great things about the .NET platform is that when compiled, it is
    language independent. With Visual Studio.NET C#, and VB.NET both compile to
    IL code. The CLR runs the IL code, which cares neither if it's written in
    VB.NET or c# or Managed C++, etc...

    It's quite simple really, Add the compiled VB.NET assembly to your C#
    projects references. Now you should be able to call and instantiate the
    VB.NET objects and methods just like c# code. You can add this reference by
    right clicking on the References folder in your c# project and select Add
    Reference, then you can browse to the VB.NET assembly. The Namespace should
    now be available from within your code, just like the .NET frameworks.

    sean


    Comment

    Working...