Hi,
I m getting this compiling error in asp.net ..
"Could not write to output file 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\needsunlimited\a2548f63\3bfeee38\App_Web_eg94tkhh.dll' -- 'Access is denied. '"

Please any Help me..

Dani AI

Generated

This error means the ASP.NET build/worker process cannot create the generated assembly in the Temporary ASP.NET Files directory — most often because the account doing the build does not have write access or because another process is holding the DLL open. Given is only editing markup (not using XmlSerializer per ), the fault is typically environmental (permissions, locks, antivirus) rather than a markup bug. ’s note about temp-folder permissions is on target; below are practical, safe steps to diagnose and fix it.

Start by confirming which account runs the site (IIS Manager → Application Pools → Advanced Settings → Process Model → Identity). Modern IIS uses virtual accounts like IIS APPPOOL\<AppPoolName>; older installs use NETWORK SERVICE or a custom account. Give that exact account write access only to the ASP.NET temp folders and to whatever %TEMP% the process uses. Useful commands (run elevated):

takeown /f "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files" /r /d y
icacls  "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files" /grant "<APP_POOL_ACCOUNT>":(OI)(CI)F /T

Replace <APP_POOL_ACCOUNT> with the identity you found (for example IIS APPPOOL\DefaultAppPool or NT AUTHORITY\NETWORK SERVICE).

If the Security tab is missing in Explorer, that can be caused by a non-NTFS volume or by OS UI settings (e.g., Simple File Sharing on older Windows). Converting to NTFS is not enough by itself if ownership/ACLs weren’t reset — use the takeown/icacls sequence above. To clear locks, stop the site or recycle the app pool, delete the contents of the Temporary ASP.NET Files folder, then start the site so ASP.NET can rebuild. If a DLL still won’t be removed, use Sysinternals Process Explorer or Handle (run as admin) to find which process holds the file. Also check antivirus/web-scanner exclusions and verify there’s free disk space.

As a last repair step for a corrupted registration, re-register ASP.NET for v2.0 with aspnet_regiis -i from the v2.0 framework folder. Do not grant broad Full Control to the entire Windows folder — restrict changes to the specific temp/ASP.NET temp locations. If the problem persists, the exact compiler error code (for example CS0016), the OS and IIS versions, and the full error text are the most useful details for further diagnosis.

Recommended Answers

All 4 Replies

Are you using an XmlSerializer when this error occurs during runtime, or is this a compile time error? Could you also include the error number.

Also check this posting:
http://www.dotnetfunda.com/forums/thread146-cs0016-could-not-write-to-output-file-cwindowstemporary-aspn.aspx

thx for replying.
i m not using XmlSerializer.. i have not yet started coding, i m just designing master page(putting panels and tables).
i have visited this thread but in my property there is not security tab. i have converted my fat32 system ntfs also..

Is this a runtime error when you launch the debugger or is it happening while you are designing the site? Do you see it in the IDE or in the browser? Can you paste the _complete_ error information?

This may due to some permission setting in Temp folder. To solve it,

1. Go to %Systemroot%, normally C:\WINDOWS or C:\WINNT
2. Right-click the Temporary folder (mine is C:\WINDOWS\Temp) and select Sharing and Security. Select the Security tab and take a look at the list of “Group or user names:”
3. NETWORK SERVICE should be in the list. If it is not, click Add and type Network Service in the text box:
4. Make sure NETWORK SERVICE have Full Control in the Permissions list.
5. Click OK.
6. Restart IIS (Run iisreset)

Tell me if it works

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.