Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Calling C# from a VB.Net project

Options
  • 19-04-2005 4: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 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 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