I need help with an error.

Please help me solve this it keeps popping up and its annoying
Error:

Unhandled Exception: System.UnauthorizedAccessException: Access to the path “C:\Users\TacticsTV\Documents\Advanced Combat\Temp\Assembly-CSharp-firstpass.dll.mdb” is denied.

at System.IO.FileStream…ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in :0

at System.IO.FileStream…ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean isAsync, Boolean anonymous) [0x00000] in :0

at System.IO.FileStream…ctor (System.String path, FileMode mode, FileAccess access) [0x00000] in :0

at Mono.CompilerServices.SymbolWriter.MonoSymbolWriter.WriteSymbolFile (Guid guid) [0x00000] in :0

at Mono.CSharp.SymbolWriter+SymbolWriterImpl.WriteSymbolFile () [0x00000] in :0

at Mono.CSharp.SymbolWriter.WriteSymbolFile () [0x00000] in :0

at Mono.CSharp.CodeGen.Save (System.String name, Boolean saveDebugInfo, Mono.CSharp.Report Report) [0x00000] in :0

at Mono.CSharp.Driver.Compile () [0x00000] in :0

at Mono.CSharp.Driver.Main (System.String args) [0x00000] in :0

The first line kinda explains it all. For some reason when it tries to access C:\Users\TacticsTV\Documents\Advanced Combat\Temp\Assembly-CSharp-firstpass.dll.mdb It is unable to.
I don’t think the Users folder requires admin privileges so my guess is that file is either write protected as some other portion of the code is still accessing the file or the file hasn’t been created before the code tries to access that file. There are probably other possibilities but they escape me at the moment. some trouble shooting to figure out what code is causing the bug and what that code looks like will probably be fruitful. I’m not an Über unity user and really only code as a hobby so if someone with more experience wants to take a crack at this then by all means.

it looks like you’re trying to write to an area of the hard drive that you or unity doesn’t have access to write to.

adding a try/catch with the problematic code inside of it will keep it from crashing.

try{ 
    // the block of code causing the crash here
}catch (System.UnauthorizedAccessException exception){
    // log the error here    
}

i’d also try reading/writing to a default unity location and see if it still comes up with the error.