Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Calling C# from a VB.Net project

  • 19-04-2005 04:33PM
    #1
    Closed Accounts Posts: 1,156 ✭✭✭


    Hi folks, I have a class written in C# and am trying to access its functions from a VB.NET project. Ive tried including the source file in the Project and Ive tried creating a C# project in the same solution. Still cant seem to access it. Any ideas?

    Thanks a mil !


Comments

  • Registered Users, Registered Users 2 Posts: 640 ✭✭✭Kernel32


    I assume the C# code is inside a class library? If so the easiest configuration for development is to create a solution, add the VB.Net project, add the C# project. In the VB.Net project add a project reference to the C# project. In the VB.Net project you can then use the namespaces in the C# class library.


  • Closed Accounts Posts: 1,156 ✭✭✭DaBreno


    Thanks for the reply. Unfortunatley I still cant get the C# functions to appear in the project. My C# project is called "OracleAccess" and its only file is "OracleHelper.cs". They are in the same solution as my VB.NET project and I have referenced the C# project so the name appears in the "References" area of my VB.NET project.
    Yet I still cant reference either name - it tells me "Name 'TheFileImTryingToCall' is not declared." Damn you Microsoft!


  • Registered Users, Registered Users 2 Posts: 2,800 ✭✭✭voxpop


    make sure you have the same namespaces or at least import the c# namespace


  • Closed Accounts Posts: 1,156 ✭✭✭DaBreno


    make sure you have the same namespaces or at least import the c# namespace

    Bingo! That did the job. Cheers Sir. :D


Advertisement