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.