I don't know how to use multiple programming languages at the same time on ASP. NET websites)

Source: Internet
Author: User

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>.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.