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 !!!