The type cannot be created after ashx is deleted by mistake, and ashx cannot be created by mistake.

Source: Internet
Author: User

The type cannot be created after ashx is deleted by mistake, and ashx cannot be created by mistake.
Description

Today, because of temporary issues, you need to take a trip to other cities, and the project is quite busy. So I can only continue Typing Code in the car. The unlucky touchpad allows me to accidentally delete a general ashx handler. The code for this file is still very long.

My approach is to [recycle bin] → [restore] → [Include in project] In ]. Thought it was done.

Then the error message "failed to create type..." appears ......

"/" Indicates a server error in the application. Analyzer Error

Note:An error occurred while analyzing the resources required to provide services to this request. Check the following detailed analysis error information and modify the source file as appropriate.
Analyzer error message:The "Shop. Web. admin. SiteController" type cannot be created ".
Source error:

Row 1: <% @ WebHandler Language = "C #" CodeBehind = "SiteController. ashx. cs" Class = "Shop. Web. admin. SiteController" %>

Source file:/Admin/SiteController. ashxRow:1

 

Version:Microsoft. NET Framework Version: 4.0.30319; ASP. NET version: 4.0.30319.34248

Rough experience

I have found many posts on the Internet, but it is not necessary. It seems that none of them match. Later, I ran to the MSDN developer community. I saw this scene.

It can be said that my heart collapsed when I saw this scene.

Solution

Later, I had a hard time thinking. I think so.

[Failed to create type] It must be because of my type, which has already appeared in the Assembly. All I have to do is clear the compiled results.

Then I found the local folder of the website and deleted all files under [obj] → [Debug. Then re-compile and F5 start debugging.

OK ~~~~

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.