VS2013: How to use a VB/ASP.Net project in a C#/ASP.Net solution?

Hi,
I have a Visual Studio 2013 solution and there is 1 component I have not been able to translate to C# so my question is, can you tell how can I use an existing vb.net (VS2013) be used in an existing C#/ASP.Net Solution? I know in a solution you can mix both languages in different projects, but I dont know how to do it.

My solution is a website that first validate a user against Active Directory, If the user does not have a valid account in AD the solution will check the user against a local server. If a user exists in AD or LocalServer my page will take the username, password and have to pass it to another system called Documentum to run queries. This last one part is the VB.Net project.

Is this possible or can I do it? suppose I have in my page 2 textboxes (txtUsername and txtPassword) and one buton (btnValidateUser).
LVL 2
José PerezAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fernando SotoRetiredCommented:
So you already have a C# project in a solution. Now to add the VB .Net code you can do the following.

In Solution Explorer select the solution node that is the top most node in that window. Then right click on it and select Add -> New Project. In the New Project window select on the left side select Visual Basic and on the right side select Class Library and give it a name and click OK. The code window opens for the just added VB project. You can add code to that new window and make sure that the functions you want to call are Public otherwise you will not be able to see them in the C# project. Once you have done this compile the project so that the code becomes available to the solution. Now go to the C# project and add a reference to the VB project by right clicking on the C# project name and selecting Add->Reference and in the new window select Project in the left panel and select the VB project on the right and then click on the OK button. In the C# code add a using statement to the VB project. Then all that is needed now is to instantiate the VB class as normal and use that reference to call the functions from the VB class.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.