ASP.Net 2.0 – Multiple Languages in the App_code folder

  

The app_code folder in an Asp.Net 2.0 website can contain .net source code which is automatically compiled at run-time and available across the web application. The app_code folder can contain traditional VB.Net (.vb files), c# class files (.cs files) or non-language specific files such as WSDL and XML Schema files – proxies are automatically compiled for these files.

 

The language is derived by the compiler based on the class extension for .vb and .cs files. Since a single assembly is compiled for all the source code in the folder, only files in a single language can be included at a time. If the app_code folder contains only wsdl or schema files, the language is derived based on the default compiler for web applications specified in the web.config or machine.config file.

 

The app_code folder can contain multiple folders which are compiled into a single assembly by default.

 

If you need to include source code in multiple languages, you can include multiple subfolders under the app_code folder and treat these sub-folders as separately compiled units by specifying the directoryName in the codeSubDirectories folder in the web.config file. The language does not need to be specified here, since the language is derived by the compiler automatically as described above.