.net error CS0016: could not write to output file

In .net 4 (C#, VS 2010), I'm getting this exception for a Winforms app (not ASP).

Unable to generate a temporary class (result=1).
error CS0016: Could not write to output file 'c:\Users\user\AppData\Local\Temp\vker251c.dll' -- 'Access is denied. '

I've checked the folder in question; EVERYONE has full access rights. Any ideas? Most of what I've seen on the subject concerns ASP and doesn't seem to apply to me.
Who is Participating?
BlearyEyeConnect With a Mentor Author Commented:
I switched my TMP and TEMP environment variables to another folder and things started working. I suppose the problem is one of permissions, though I can't see any problem with what they were originally.
BlearyEyeAuthor Commented:
I can try it, but it's also IIS-related and doesn't seem quite relevant to my winform problem.
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

AndyAinscowFreelance programmer / ConsultantCommented:
>>Could not write to output file 'c:\Users\user\AppData\Local\Temp\vker251c.dll'

You are attempting to write to a dll - is that correct?  (If yes then is code in the dll in use by your app ?)
BlearyEyeAuthor Commented:
Andy: I don't know the answer to that question since the name of the dll doesn't mean anything to me. It seems to be an artifact of the compiler.
BlearyEyeAuthor Commented:
My solution worked, though I don't really know why.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.