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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Calling C# from a VB.Net project

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