Bharath Radhekrishna

Place vb and cs files together in App_Code folder

Posted by: onetidbit on: November 25, 2008

Sometimes while using class files in asp.net we will face the situation where we want to place both Vb and Cs class files.The simple solution is:

1) First make two folders in App_code with foldernames as 1)CSCode 2)VBCode

2) Modify the Web.conig with following code:

    <compilation debug="false">
    <codeSubDirectories>
        <add directoryName="VBCode" />
        <add directoryName="CSCode" />
    </codeSubDirectories>
</compilation>

Thats all.....

5 Responses to "Place vb and cs files together in App_Code folder"

I have a class in VBCode folder and another class in CSCode folder. Both classes are in the same namespace.
But while refering the Class defined in VBCode folder inside the Class in CSCode folder it gives an error

Error 21 The type or namespace name ‘MyClass’ could not be found (are you missing a using directive or an assembly reference?)

Do you know how could i make this reference work?

Have you solved that?

Excellent post, Good Work, keep it up

:Ajay
http://twitter.com/matharuajay

Nice post, I was wondering how can we use class files with different extensions in APP_CODE.You solved my prob.

Thanks a ton.
:Ashish
http://twitter.com/ashishsalvi

Amazing post!!!!!!!!!!!!!!!!

:Kunal Sidhpura
http://twitter.com/kunalsidhpura

Leave a Reply