Cs0016: failed to write (a compilation error has occurred. httpcompileexception: Error cs0016: cocould not write

Source: Internet
Author: User

The project has been deployed quite well. When I use it today, I suddenly report an error in my diary!

System. unauthorizedaccessexception: access to the temp directory Is Denied. Identity ' IIS apppool \ zbs_remoter_20104 ' Under which xmlserializer Is Running does not have sufficient permission to access the temp directory. codedom will use the user account the process Is Using To Do The compilation, so If The user doesn �t have access to system temp directory, you will not be able to compile. Use path. gettemppath () API to find Out The temp directory location.

Server stack trace:
At system. xml. serialization. compiler. Compile (Assembly parent, string NS, xmlserializercompilerparameters xmlparameters, evidence)
At system. xml. serialization. tempassembly. generateassembly (xmlmapping [] xmlmappings, type [] types, string defaultnamespace, evidence eviters, xmlserializercompilerparameters parameters, assembly, hashtable assemblies)
At system. xml. serialization. xmlserializer. getserializersfromcache (xmlmapping [] mappings, type)
At system. xml. serialization. xmlserializer. frommappings (xmlmapping [] mappings, type)
..................

In the browser, the following error message is returned:

Error cs0016: cocould not write to output file ' C: \ windows \ Microsoft. NET \ framework \ v4.0.30319 \ temporary ASP. Net files \ Root \ 62dbbf01 \ a08ea1a8 \ app_global.asax.qujxfrcb.dll ' -- ' Access denied. ' At system. web. compilation. assemblybuilder. compile () at system. web. compilation. buildproviderscompiler. extends mbuild () at system. web. compilation. applicationbuildprovider. getglobalasaxbuildresult (Boolean isprecompiledapp) at system. web. compilation. buildmanager. compileglobalasax () at system. web. compilation. buildmanager. ensuretoplevelfilescompiled () at system. web. compilation. buildmanager. callappinitializemethod () at system. web. hosting. hostingenvironment. initialize (applicationmanager appmanager, iapplicationhost apphost, iconfigmappathfactory configmappathfactory, hostingenvironmentparameters hostingparameters, policylevel, exception appdomaincreationexception)
........................
At system. web. compilation. assemblybuilder. compile () at system. web. compilation. buildproviderscompiler. extends mbuild () at system. web. compilation. applicationbuildprovider. getglobalasaxbuildresult (Boolean isprecompiledapp) at system. web. compilation. buildmanager. compileglobalasax () at system. web. compilation. buildmanager. ensuretoplevelfilescompiled () at system. web. compilation. buildmanager. callappinitializemethod () at system. web. hosting. hostingenvironment. initialize (applicationmanager appmanager, iapplicationhost apphost, iconfigmappathfactory configmappathfactory, hostingenvironmentparameters hostingparameters, policylevel, exception appdomaincreationexception)

It was very strange that the prompt was:

Cs0016: cocould not write to output file'C: \ windows \ Microsoft. NET \ framework \ v4.0.30319 \ temporary ASP. Net files \ Root \ 62dbbf01 \ a08ea1a8 \ app_global.asax.qujxfrcb.dll '-- 'Access is denied.'

I have never moved the permissions of related folders!

If you do not have the permission, tryTemporary ASP. NET filesAfter permission improvement, I found that I already have the iis_users permission. Isn't it enough? Simply give all the permissions to netword services and everyone. After I restart IIS, I still cannot. Then IC: \ windows \ TempFolder permissions are also upgraded andTemporary ASP. NET filesIn the same way, restart IIS again to access the site. Well, it's okay! You can also remove the everyone permission!

In the end, I don't know, so I hope you can give me some advice. This setting is too insecure!

Note: you only need to set the c: \ windows \ Temp permission !!!

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.