Click here to Skip to main content
15,850,751 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I am developing an application in 3.5 VS 2010.
i am getting an error when i run this locally

Access to the path 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\csh\ae97903f\b59101dbfa5e4a2ba40c1081a6dbdf3f-1.cs' is denied.
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.UnauthorizedAccessException: Access to the path 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\csh\ae97903f\b59101dbfa5e4a2ba40c1081a6dbdf3f-1.cs' is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

stack trace

[UnauthorizedAccessException: Access to the path 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\csh\ae97903f\b6fb17d9ae554c92830562c5434d2bd0-1.cs' is denied.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +7719199
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +1162
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) +67
   Spark.Compiler.BatchCompiler.Compile(Boolean debug, String[] sourceCode) in C:\Users\Administrator\Downloads\loudej-spark-70c418d\src\Spark\Compiler\BatchCompiler.cs:71
   Spark.Compiler.CSharp.DefaultViewCompiler.CompileView(IEnumerable`1 viewTemplates, IEnumerable`1 allResources) in C:\Users\Administrator\Downloads\loudej-spark-70c418d\src\Spark\Compiler\CSharp\DefaultViewCompiler.cs:30
   Spark.SparkViewEngine.CreateEntryInternal(SparkViewDescriptor descriptor, Boolean compile) in C:\Users\Administrator\Downloads\loudej-spark-70c418d\src\Spark\SparkViewEngine.cs:234
   Spark.SparkViewEngine.CreateEntry(SparkViewDescriptor descriptor) in C:\Users\Administrator\Downloads\loudej-spark-70c418d\src\Spark\SparkViewEngine.cs:210
   Spark.SparkViewEngine.CreateInstance(SparkViewDescriptor descriptor) in C:\Users\Administrator\Downloads\loudej-spark-70c418d\src\Spark\SparkViewEngine.cs:193
Nirav Prabtani 1-Jul-13 7:32am    
are you working in source safe or TFS?????
ravithejag 2-Jul-13 0:06am    
Nirav.i am working in TFS

Share this answer
But giving Everyone or iis user permission to the solution folder as Read write.The issue will be solved then.

C:\Windows\Temp and C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files folder.
The issue is fixed.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900