Hi,

I am trying to re-use some VB code in my C# app but can't get them to compile together. I have read about dividing them in the App_Code folder, and I have done that and added the subfolders to web.config. However, now when I try to compile, I get an error on my VB code : a namespace does not directly contain members such as fields or methods.

I tried a very simple class:

Public Class testVB
    Public Function Hello()
        Msgbox("HI")

    End Function
End Class

and the same thing occurred. Any help is appreciated.

Also, supposing that mixing the code is okay, how would I go about calling a VB subroutine which returns 2 values from C#? Would the code have to be changed? Thanks

Create a library project (DLL) and paste your vb.net classes and build it. In asp.net project, add the reference of library project dll to use that compiled code in your asp.net c# application.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.