We all know that when creating a new ASP. NET page, you can select differentProgramming Language. That is to say, in the same site, page a is written in C #, while page B is written in VB. NET. (This is not nonsense)
However, I used to think that classes under the magic directory "app_code" must be written in the same programming language. That is to say, if app_code has two classes: vbclass. VB and csharpclass. CS, which are written in C # and VB. NET respectively, the following error will be prompted during compilation:
The files '/website/app_code/vbclass. VB' and '/website/app_code/csharpclass. CS' use a different language, which is not allowed since they need to be compiled together.
Now you can correct this point of view. In fact, we can also use different programming languages to write classes in app_code. The method is to place classes in different programming languages under different sub-directories. For example, all classes written in C # are directly placed in the app_code directory, then create a sub-directory under the app_code directory, such as vbcode, and all VB. all classes written in. NET are placed in the vbcode directory, and then modify the web. config settings:
<Compilation> <codesubdirectories> <add directoryname = "vbcode"/> </codesubdirectories> </compilation>
The key lies in the setting of <codesubdirectories>.