Use CS and VB files in App_Code

We all know that App_Code folder contains source code files written as traditional class files — that is, files with a .vb extension, .cs extension, and so on.

But when we keep .cs and .vb file together in one folder and try to build the project it throws errors. So to successfully build the project we follow two simple steps .

Step#1 : Create two folders VBCode for .vb files and CSCode for .cs files.

Step#2:  Modify web.config file.

<add directoryName="CSCode"/>
<add directoryName="VBCode"/>

That’s all, Hope this helps.
Enjoy !! 🙂

3 thoughts on “Use CS and VB files in App_Code

  1. Bo Godthaab

    Salviashish Hi,
    I have a project need to run both CS and VB and the compilation goes fine according to your guidelines.
    My problem is that I am from a UserControl normally use this call: WebEditor(“Telerik.Samples.LinksListItemEditor, App_Code”) and it does not work.
    Do you know how to perform this reference correct to CSCode?

    Best regards

  2. Lana

    Thanks so much for this! I was getting ready to spend a lot of time trying to convert C# code to VB. I had no idea you could blend both in one project. Many Thanks for sharing!


Leave a Reply

Your email address will not be published. Required fields are marked *