I am encountering issues while deploying an ASP web application to HostMySite. The application has previously been deployed to their servers that are on different platforms without issues. However, for the current domain and server I continue to get the server error below.
Server Error in ‘/PropertyManagement’ Application.
The current identity (ADSAFESECUREWEB\C116018-fhmonlinea) does not have write access to ‘C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files’.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The current identity (ADSAFESECUREWEB\C116018-fhmonlinea) does not have write access to ‘C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files’.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. I know that the code is not explicitly attempting to write to the .NET temporary directory but, I was wondering if the application is somehow using that directory during run-time. The host keeps telling me that I have to configure my application to not use the temporary directory since they will not provide read/write access to it. Can someone please tell me why my application might be attempting to use this directory and what I can do to configure it to use a different directory that I have access to. I am new to ASP development and need help. Thanks!
Stack Trace:
[HttpException (0x80004005): The current identity (ADSAFESECUREWEB\C116018-fhmonlinea) does not have write access to ‘C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files’.]
System.Web.HttpRuntime.SetUpCodegenDirectory(CompilationSection compilationSection) +11650831
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +323
[HttpException (0x80004005): The current identity (ADSAFESECUREWEB\C116018-fhmonlinea) does not have write access to ‘C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files’.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11612256
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4842149
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
The CLR copies all your assemblies to that directory and compiles your .aspx/.asmx/etc files and puts the compiled version in Temporary ASP.NET Files.
This must be writable so that your site can be compiled at runtime.
Edit: Here is an MSDN article explaining it.
As discussed in the comments, if the provider refuses to let you write to that directory, you can override it by putting the following in your
web.config, ‘system.web’ section: