Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Constantly getting this error

Discussion in 'Editor & General Support' started by Gerald Tyler, Aug 2, 2015.

  1. Gerald Tyler

    Gerald Tyler

    Joined:
    Jul 10, 2015
    Posts:
    80
    The following error message has popped up in my console literally dozens of times now and I'd like to get it resolved permanently:

    Unhandled Exception: System.UnauthorizedAccessException: Access to the path "C:\Users\Gerald\Desktop\Game Design\Game Name\Temp\Assembly-CSharp.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 <filename unknown>:0

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

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

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

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

    at Mono.CSharp.SymbolWriter.WriteSymbolFile () [0x00000] in <filename unknown>:0

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

    at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0

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

    Whenever this happens, I have to manually save my C# script with "Save As", then save my scene, then save my project and close the program entirely, then reload it before it'll let me continue working in it.

    Thoughts?
     
  2. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Not sure if this is relevant or not, but maybe check anti-virus and see if it's locked the mdb file.
     
    Gerald Tyler likes this.
  3. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,201
    We're seeing more and more UnauthorizedAccessExceptions during compiles, on different computers with different anti-virus software. It's always one of the .dll.mdb files - either CSharp or Boo - on games written in CSharp and Boo respectively. I haven't been able to lock it down enough to send a bug report, but I'm pretty certain that this is a consistent error.

    I can usually fix it by just adding a space to whatever script I'm working on - recompiling is not enough, though.
     
    Gerald Tyler likes this.
  4. ForceVFX

    ForceVFX

    Joined:
    Jan 21, 2011
    Posts:
    612
    1). Unblock unity editor in av firewall settings.
    2). Temporarily turn off any av real time scanning.
    3). Launch unity as administrator.

    just my top 3.

    P
     
    Gerald Tyler likes this.
  5. Gerald Tyler

    Gerald Tyler

    Joined:
    Jul 10, 2015
    Posts:
    80
    K thanks everybody
     
  6. ebrewe

    ebrewe

    Joined:
    Jan 9, 2015
    Posts:
    2
    I get this too. Already tried adding exceptions in my antivirus and now I just turn it off. Unity and Monodevelop both running as admin. Still happens continually. Every time I save a file through Mono, I have to close and restart unity (sometimes a few times) to get rid of the error.

    ---- Edit ----

    As Baste indicated, sometimes adding a space removes the error but I've found it needs to be done a couple of times.