C # Why can't a web application access classes under app_code,

Source: Internet
Author: User

C # Why can't a web application access classes under app_code,

When using C # To develop a web application, you can create a website or an application. Applications use more of these methods, classes under app_code can be accessed under website, but are not supported by applications.

Solution: Change the class property generation operation under app_code from "content" to "compile ".

In this way, the classes in app_code are the same as those in normal folders.

By the way, Baidu has the difference between Content and compilation. Content-does not compile the file, but includes it in the Content output group. Compile-Compile the file into the generated output. This setting is used for code files. C # When adding a project to Solution Explorer, you need to set the file type to the compilation type. The. cs file refers to the compiled code file.

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.