Why can't I reference classes in app_code? (discussed in csdn)

Source: Internet
Author: User
For Web ApplicationsProgramYou cannot add an ASP. NET folder by right-clicking project> Add->. Because the app_code in the Web application does not exist.
However, you can manually create a folder and name it app_code. In this way, the app_code created in the website looks the same.
Don't be happy. It's not that simple.
When you create a class in app_code, you will find no smart prompts. When the page is referenced in the background, an error is reported, indicating that the reference does not exist.
The solution is to select your class file and change the "generate operation" default "content" in the "advanced" attribute to compile.
This is enough.

You can also add "app_localresources" to the Web application project. You can add classes in this folder without adding the app_code folder.
You can also create any folder or directly add classes without folders. You only need to modify the "generate operation" of the class's advanced attributes to "compile ".
Modify, delete, report, reference, and reply

Add as a friend

Send private message

Online Chat
  • yokenhou
  • risk shadow
  • level:
  • available score: treasurer
  • total technical score: total technical score ranking: 9526
published on: 01:24:37 7 floor score: 0
to: zylovegxs
your answer is too good. I have found many posts, many people have encountered the same problem and got the correct answer here.
after SP1 is installed, the classes in app_code cannot be automatically referenced because they do not pass the settings you mentioned.
many people have replied that they can use namespace. classname directly, but they cannot.
thank you for your answer. It helped me solve the big problem.

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.