title: Compilation error with access to Temporary ASP.NET folder
body: <p>We have an <code>ASP.NET 4.5.2</code> application which runs fine in one Application server running <code>Windows Server 2007 with IIS 7</code>.</p>
  
  <p>We installed <code>.NET 4.5.2</code> in another server and installed the ASP.NET feature alongwith IIS in another <code>Windows Server 2007</code> and we face the below error message.</p>
  
  <p>We tried the following with no solution:</p>
  
  <ol>
  <li>Registered ASP.NET using the tool <code>aspnet_regiis.exe -I</code></li>
  <li>Gave the IISUSRS account full control on the Temporary ASP.NET files folder</li>
  <li>Gave the NETWORK SERVICE account full control on the Temporary ASP.NET files 
  folder</li>
  </ol>
  
  <p><strong><em>What are we missing here?</em></strong></p>
  
  <p><strong>Error message:</strong></p>
  
  <blockquote>
    <p>Server Error in '/AppName' Application.</p>
    
    <p>Compilation Error 
    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. </p>
    
    <p>Compiler Error Message: CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\App_Web_index.cshtml.a8d08dba.ez1dx_35.dll' -- 'The directory name is invalid. '</p>
  </blockquote>
  
  <p>Source Error:</p>
  
  <blockquote>
    <p>[No relevant source lines]</p>
    
    <p>Source File:    Line: 0 </p>
    
    <p>Show Detailed Compiler Output:</p>
    
    <p>c:\windows\system32\inetsrv> "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe" /t:library /utf8output /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\dffeff90\00aff703_2ae8d201\Newtonsoft.Json.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\2ff5c9d4\00b4f9b4_4a6acd01\Microsoft.Web.Infrastructure.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\a017fc88\009bb57c_3998d201\log4net.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\e5a0ac1f\00d5e207_a73ad001\System.Web.Http.WebHost.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\bebb8758\3cc50a3f_c9bad301\AppName.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\a7ba3bd7\00a6d731_3527cf01\System.Web.Optimization.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\d910691c\00b31c22_a73ad001\System.Web.WebPages.Razor.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\7c27f881\00b31c22_a73ad001\System.Web.WebPages.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_64\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\458137ac\8d76efa5_c7bad301\Microsoft.SharePoint.Client.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\f0a6f480\d3933ecf_c9bad301\App_global.asax.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\f034574c\00600d23_32aece01\Antlr3.Runtime.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\3d033c38\00b31c22_a73ad001\System.Web.Helpers.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\a464816c\0035bde1_a63ad001\System.Net.Http.Formatting.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\f7fce061\00196fd3_a63ad001\System.Web.Mvc.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\de39cb0e\0054c7db_a63ad001\System.Web.Razor.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\547c7c96\00deeca5_c7bad301\Microsoft.SharePoint.Client.Runtime.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\22053588\0043e4e8_a63ad001\System.Web.Http.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\b650433a\00b3fcae_3a18cf01\WebGrease.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\assembly\dl3\df4b1f70\00b31c22_a73ad001\System.Web.WebPages.Deployment.dll" /out:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\App_Web_index.cshtml.a8d08dba.ez1dx_35.dll" /D:DEBUG /debug+ /optimize- /w:4 /nowarn:1659;1699;1701;612;618 /warnaserror-  "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\App_Web_index.cshtml.a8d08dba.ez1dx_35.0.cs" "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\App_Web_index.cshtml.a8d08dba.ez1dx_35.1.cs"</p>
    
    <p>Microsoft (R) Visual C# Compiler version 4.0.30319.34209</p>
    
    <p>for Microsoft (R) .NET Framework 4.5
    Copyright (C) Microsoft Corporation. All rights reserved.</p>
    
    <p>error CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\AppName\1cfff99b\3c94e931\App_Web_index.cshtml.a8d08dba.ez1dx_35.dll' -- 'The directory name is invalid. '</p>
    
    <p>Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34209 </p>
  </blockquote>