Calling C# from VB.Net

  • Thread starter Thread starter kevininstructor
  • Start date Start date
You first have to build the C# code in its own project into a *.dll file and
then you set reference to it in the calling VB.NET project. You cannot use
different language in the same project.
 
Put the C# file into another project (class library) and add a project
reference in the VB.NET web app. You cannot mix languages in a single
project (at least not until VS.NET 2005).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************************************************
Think outside the box!
***************************************************************
 
Hi Kevin,

Thanks for your post. As suggested by Norman and Gregory, you will need to
put C# file in a separate project (class library). In addition, please
refer to the following MSDN articles for the sample and detailed
information:

Cross-Language Inheritance
http://www.vbip.com/books/1861004915/chapter_4915_12.asp

C# and the .NET Platform - Chapter 6
http://www.codeproject.com/books/1893115593_6.asp

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Thanks Norm!

Norman Yuan said:
You first have to build the C# code in its own project into a *.dll file and
then you set reference to it in the calling VB.NET project. You cannot use
different language in the same project.
 
Thanks Cowboy!

Cowboy (Gregory A. Beamer) said:
Put the C# file into another project (class library) and add a project
reference in the VB.NET web app. You cannot mix languages in a single
project (at least not until VS.NET 2005).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************************************************
Think outside the box!
***************************************************************
 
Back
Top