Error Handling-you cannot forcibly convert an object of the master type to the master type.

Source: Internet
Author: User

Example of error information:
The following error information is an example of the exception type during running when you encounter these compilation problems:

 

Unable to cast object of Type 'asp. masterpage_master 'to type 'asp. masterpage_master '.
(You cannot convert an ASP. masterpage_master object to an ASP. masterpage_master object)
Or:

Cocould not load file or assembly 'app _ web_e9dbmaj, version = 0.0.0.0, culture = neutral, publickeytoken = null' or one of its Dependencies. The system cannot find the file specified.
(Files cannot be loaded orProgramSet "app_web_e9dbmaj, version = 0.0.0.0, culture = neutral, publickeytoken = NULL" or its dependency direction. The system cannot find the specified file .)
Or:

Compiler error message: cs0006: Metadata File 'C: \ windows \ Microsoft. net \ framework \ v2.0.50727 \ temporary ASP. net files \ CMS. WEB \ 44e73607 \ b028acb3 \ app_global.asax.fakktchx.dll 'could not be found
(Compilation error message: cs0006: the metadata file "C: \ WINDOWS \ Microsoft. net \ framework \ v2.0.50727 \ temporary ASP. net files \ CMS. WEB \ 44e73607 \ b028acb3 \ app_global.asax.fakktchx. DLL ".)
Or:

System. invalidoperationexception: The resource class for this page was not found. Please check if the resource file exists and try again
(System. invalidoperationexception: The resource class on the current page cannot be found. Check whether the resource file exists and try again .)
Temporary solutions for these problems:
If an application starts to throw one of the preceding errors, you can apply a temporary solution immediately to open the web of your application. config File, set the batch attribute of the <compilation> section to false:

<Configuration>

<System. Web>
<Compilation DEBUG = "false" batch = "false"> </compilation>
</System. Web>

</Configuration>
This tells ASP. NET to dynamically compile a single. aspx/. ascx file into a separate assembly, which avoids the issue of triggering abnormal circular references.

You can also use the following steps to delete the files in the "temporary ASP. NET files" cache to temporarily solve this problem:

Click Start in windows, run, enter iisreset/stop, and click OK.
Open the driver letter: Windows \ Microsoft. NET \ framework \ v2.0.50727 \ temporary ASP. NET Files directory.
Delete all files and all folders in the directory you found in step 2.
Click Start, click Run, enter iisreset/start, and then click OK.

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.