Local IIS 7.5 - CS0016: Could not write to output file

I was running VS 2010 for MVC4 application with dotnet framework4.0. While running the application for asp.net development server it works fine. After that I thought I’ll run with IIS server. 

Then I got the error: 

'Could not write to output file
C:\windows\Microsoft.Net\Framework64\v4.0.30319\Temporary ASP.Net Files’.

Compiler was showing error message

CS0016: Could not write to output file 'c: \Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\62d43c41\27d749ca\App_Code.7lodcznm.dll' – 'Access denied.'

After getting this error I thought may be some problem with IIS server as application 
was working fine with asp.net inbuilt server. So I restarted the server and restarted my visual studio, but no luck. I got the same error message.

Then I searched for some article and found the solution on web. And my application start working with IIS Server.

I thought I will write in my blog and share the experience so that it’ll be helpful for others also.

So here is solution:

1Go to
                'C: \Windows\Microsoft.NET\Framework64\v4.0.30319'

    Right mouse click on   ’Temporary ASP.Net Files’ -

               Properties- Security tab-
               From ‘Group or user Names’ box select ‘IIS_IUSRS’
    Click edit button. You see the below ‘permission’ box is now highlighted. 
    Check the Full control. 

Temporary ASP.NET Files Properties




































2. Go to

   ‘C:\windows\temp‘
    and do same as above for temp folder.


Windows Temp Folder Properties


































3. Restart the IIS. 

Now run the application. It'll work.



Local IIS 7.5 - CS0016: Could not write to output file Local IIS 7.5 - CS0016: Could not write to output file Reviewed by kamal kumar das on July 13, 2015 Rating: 5

No comments:

ads 728x90 B
Powered by Blogger.