Classes placed in the app_code folder of ASP. NET programs can be automatically compiled into an assembly. all the classes and methods used in the Assembly on the page will be automatically called and updated, which is very easy to maintain. However, the classes in this folder can only be written in one language, Visual Basic. net, C #, J #, JScript .. net because it is compiled into the same assembly and processed by a compiler. To use different languages, you must use folders to group class files and add necessary configurations to the configuration file, the build system is required to create different assemblies-one assemblies for each language.
Assume there are two class files named code. CS and code. VB respectively. Because they are written in two languages, they cannot be put together in the app_code directory. Now create two folders to solve such conflicts :~ /App_code/CS and ~ /App_code/Vb, and put the two files in the corresponding folder respectively. Add the following configuration in Web. config:
<Configuration> <compilation> <codesubdirectories> <add directoryname = "CS"/> <add directoryname = "VB"/> <codesubdirectories/> <compilation/> </configuration>
Note: <codesubdirectories> must be placed under the <compilation> node.