Unauthorized Access Error

I always come across this error message on my console after a point of time:
Internal compiler error. See the console log for more information. output was:
Unhandled Exception: System.UnauthorizedAccessException: Access to the path “C:\Users..Temp\Assembly-CSharp-Editor.dll.mdb” is denied
. I tried restarting unity but it kept showing this error again and again. I searched through the net and somewhere I came across a suggestion to turn off my antivirus software and restart unity3d and it worked. My question is: What role has the antivirus software got to do with this error?

If I were to guess, the antivirus software is reading through the file to check for viruses (as it does), and has registered it as open to prevent other programs from changing it until it’s done reading the file. Unity tries to change or read it, and is denied access to the file.

it has to do with your antivirus. just make a change to one of your scripts, a change that of course doesnt affect your script, like putting a space at the end of a line. then save the script and the error should go away. at least it does for me. sometimes you have to do it more than once.