Home error cs0016 could not write to output file access is denied
Reply: 6

error cs0016 could not write to output file access is denied

Manickam Chidhambaram
1#
Manickam Chidhambaram Published in 2012-06-11 05:09:52Z

Could you please help me out in fixing the following error "error: cs0016 could not write to output file...c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\sitename\6c57f9d2\bb09b49d\App_global.asax.5odzsyz5.dll' access is denied"

Iis
niltoid
2#
niltoid Reply to 2012-06-15 16:37:28Z

I was struggling with this problem for a while. Found some solutions on the web that involved setting permissions on the "Temporary ASP.NET Files" directory in the error message. But even opening it up to "Everyone" didn't work.

Then eventually the following steps fixed it:

  1. Go to the IIS AppPool for this site
  2. Right-click the app pool and go to Advanced Settings
  3. Change Identity from "ApplicationPoolIdentity" to "NetworkService"

There may also be some other necessary steps, which I did while troubleshooting, but this is the key step. For some reason the App Pool Identity (such as IIS_APPPOOL\SiteName) isn't granted access when "Everyone" is. I'm sure someone else can shed some light on why this is the case... Hopefully this helps others resolve this frustrating issue.

user2118400
3#
user2118400 Reply to 2013-08-21 17:27:29Z

After spending hours on this issue myself below is the solution that worked for me on Windows 7 running IIS 7.5:

The application pool identity associated with the site was not a member of the IIS_IUSRS group. To add the app pool identity to the group I used the following steps:

  1. From the start menu select Run… enter lusrmgr.msc and click OK.
  2. Select Groups.
  3. Double click the IIS_IUSRS group.
  4. Click the Add... button.
  5. Click the Locations... button.
  6. Select your computer name (it should be at the top of the list) and click OK.
  7. In the text box below "Enter the object names to select" enter: iis apppool\<app pool identity> e.g. iis apppool\dev
  8. Click the Check Names button. If a Name Not Found dialog box appears then verify that the app pool identity entered matches the app pool identity associated with the site. If a dialog box did not appear then click OK.

Repeat steps 7 through 8 for each app pool identity you wish to add. Click OK.

Now the app pool identity is a member of the IIS_IUSRS group which should already have access to the Temporary ASP.NET Files directory. After all that I was still receiving the error and I found (thanks to process monitor) it was because the app pool identity could not write to the windows temp directory. To resolve this I added the IIS_IUSRS group to the windows temp directory with read/write permissions.

  1. From the start menu select Run… enter %windir% and click OK.
  2. Right click on the Temp directory and select Properties.
  3. Click on the Security tab.
  4. Click the Edit... button.
  5. Click the Add.. button.
  6. Click the Locations... button.
  7. Select your computer name (it should be at the top of the list) and click OK.
  8. In the text box below "Enter the object names to select" enter: iis_iusrs
  9. Click the Check Names button. If a Name Not Found dialog box appears then check for typos. If a dialog box did not appear then click OK.
  10. Select the added IIS_IUSRS group and in the Permissions for Everyone box below select: Allow Read and Allow Write
  11. Click OK. A dialog box will be displayed stating that "You are about to change the permission settings on system folders, which can result in unexpected access problems and reduce security. Do you want to continue?"
  12. Click Yes
  13. Click OK
Jako
4#
Jako Reply to 2014-04-10 13:34:53Z

I've fixed this issue setting full control for 'NETWORK SERVICE' to the system temp:

C:\Windows\temp

The error message reported by the web server is a bit misleading. Hope this helps.

leshy84
5#
leshy84 Reply to 2016-05-12 09:33:09Z

I had the same problem. Found an easy way to resolve: Set "Load user profile" to true in app pool's advanced settings.

user2502767
6#
user2502767 Reply to 2016-03-09 17:44:32Z

I found the accepted answer on this post to be correct in process. I tried "NetworkService" and it did not work. However "LocalSystem" did!

elfekz
7#
elfekz Reply to 2017-05-22 18:47:22Z

I have all permissions about writing and reading but I'm starting to get that error.

I can suggest "restart machine" At least, it works for me

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.41063 second(s) , Gzip On .

© 2016 Powered by cudou.com design MATCHINFO