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.

internal compiler error: Unhandled Exception: System.UnauthorizedAccessException:

Discussion in 'Editor & General Support' started by vastor, Apr 24, 2012.

  1. vastor

    vastor

    Joined:
    May 6, 2010
    Posts:
    49
    starting with unity 3.5.1 i get an internal compiler error almost every time i want to compile a project, unity has no access on his own temp folder.

    I have this problem on 5 different projects. Sometimes let unity recompile all scripts help.

    here is the editor.log


    Code (csharp):
    1. - starting compile Library/ScriptAssemblies/Assembly-CSharp.dll, for buildtarget 5
    2. - starting compile Library/ScriptAssemblies/Assembly-UnityScript.dll, for buildtarget 5
    3. Refresh, detecting if any assets need to be imported or removed ... 0.039615 seconds (Nothing changed)
    4.  
    5. *** Cancelled 'Build.Player.WindowsStandalonePlayer' in 2 seconds
    6.  
    7. - Finished compile Library/ScriptAssemblies/Assembly-UnityScript.dll
    8. - Finished compile Library/ScriptAssemblies/Assembly-CSharp.dll
    9. - starting compile Library/ScriptAssemblies/Assembly-CSharp-Editor.dll, for buildtarget 5
    10.  
    11.  
    12. -----Compiler Commandline Arguments:
    13.  
    14. Filename: "C:/Program Files (x86)/Unity3.5/Editor/Data/Mono\bin\mono.exe"
    15.  
    16. Arguments: "C:/Program Files (x86)/Unity3.5/Editor/Data/Mono\lib/mono/2.0\gmcs.exe"  @Temp/UnityTempFile-86f6a6f0ebb6c4142ab31254f43edc8b
    17.  
    18. MONO_PATH: C:/Program Files (x86)/Unity3.5/Editor/Data/Mono\lib\mono\2.0
    19.  
    20. MONO_CFG_DIR: C:/Program Files (x86)/Unity3.5/Editor/Data/Mono\etc
    21.  
    22. index: 75
    23.  
    24. Responsefile: Temp/UnityTempFile-86f6a6f0ebb6c4142ab31254f43edc8b Contents:
    25.  
    26. -debug
    27.  
    28. -target:library
    29.  
    30. -nowarn:0169
    31.  
    32. -out:Temp/Assembly-CSharp-Editor.dll
    33.  
    34. -r:"C:/Program Files (x86)/Unity3.5/Editor/Data/Managed/UnityEngine.dll"
    35.  
    36. -r:"C:/Program Files (x86)/Unity3.5/Editor/Data/Managed/UnityEditor.dll"
    37.  
    38. -r:Library/ScriptAssemblies/Assembly-CSharp.dll
    39.  
    40. -r:Library/ScriptAssemblies/Assembly-UnityScript.dll
    41.  
    42. -define:UNITY_3_5_1
    43.  
    44. -define:UNITY_3_5
    45.  
    46. -define:UNITY_EDITOR
    47.  
    48. -define:ENABLE_PROFILER
    49.  
    50. -define:UNITY_STANDALONE_WIN
    51.  
    52. -define:ENABLE_GENERICS
    53.  
    54. -define:ENABLE_DUCK_TYPING
    55.  
    56. -define:ENABLE_TERRAIN
    57.  
    58. -define:ENABLE_MOVIES
    59.  
    60. -define:ENABLE_WEBCAM
    61.  
    62. -define:ENABLE_MICROPHONE
    63.  
    64. -define:ENABLE_NETWORK
    65.  
    66. -define:ENABLE_CLOTH
    67.  
    68. -define:ENABLE_WWW
    69.  
    70. -define:ENABLE_SUBSTANCE
    71.  
    72. Assets/Editor/GUIDraggableObject.cs
    73.  
    74. Assets/Editor/MyBuildManager.cs
    75.  
    76. Assets/Editor/SceneObject.cs
    77.  
    78.  
    79.  
    80. -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/Assembly-CSharp-Editor.dll
    81.  
    82. -----CompilerOutput:-stderr----------
    83.  
    84.  
    85.  
    86. Unhandled Exception: System.UnauthorizedAccessException: Access to the path "C:\work\BMWn\produktion\verkehr\unity\Temp\Assembly-CSharp-Editor.dll.mdb" is denied.
    87.  
    88.  
    89.  
    90.   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
    91.  
    92.  
    93.  
    94.   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
    95.  
    96.  
    97.  
    98.   at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access) [0x00000] in <filename unknown>:0
    99.  
    100.  
    101.  
    102.   at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess)
    103.  
    104.  
    105.  
    106.   at Mono.CompilerServices.SymbolWriter.MonoSymbolWriter.WriteSymbolFile (Guid guid) [0x00000] in <filename unknown>:0
    107.  
    108.  
    109.  
    110.   at Mono.CSharp.SymbolWriter+SymbolWriterImpl.WriteSymbolFile () [0x00000] in <filename unknown>:0
    111.  
    112.  
    113.  
    114.   at Mono.CSharp.SymbolWriter.WriteSymbolFile () [0x00000] in <filename unknown>:0
    115.  
    116.  
    117.  
    118.   at Mono.CSharp.CodeGen.Save (System.String name, Boolean saveDebugInfo, Mono.CSharp.Report Report) [0x00000] in <filename unknown>:0
    119.  
    120.  
    121.  
    122.   at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0
    123.  
    124.  
    125.  
    126.   at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0
    127.  
    128. -----EndCompilerOutput---------------
    129.  
    130. - Finished compile Library/ScriptAssemblies/Assembly-CSharp-Editor.dll
    131. Internal compiler error. See the console log for more information. output was:
    132. Unhandled Exception: System.UnauthorizedAccessException: Access to the path "C:\work\BMWn\produktion\verkehr\unity\Temp\Assembly-CSharp-Editor.dll.mdb" is denied.
    133.  
    134.   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
    135.  
    136.   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
    137.  
    138.   at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access) [0x00000] in <filename unknown>:0
    139.  
    140.   at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess)
    141.  
    142.   at Mono.CompilerServices.SymbolWriter.MonoSymbolWriter.WriteSymbolFile (Guid guid) [0x00000] in <filename unknown>:0
    143.  
    144.   at Mono.CSharp.SymbolWriter+SymbolWriterImpl.WriteSymbolFile () [0x00000] in <filename unknown>:0
    145.  
    146.   at Mono.CSharp.SymbolWriter.WriteSymbolFile () [0x00000] in <filename unknown>:0
    147.  
    148.   at Mono.CSharp.CodeGen.Save (System.String name, Boolean saveDebugInfo, Mono.CSharp.Report Report) [0x00000] in <filename unknown>:0
    149.  
    150.   at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0
    151.  
    152.   at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0
    153.  
    154. (Filename:  Line: 0)
    155.  
     
  2. vastor

    vastor

    Joined:
    May 6, 2010
    Posts:
    49
    When you ever catch your admin installing a virus scanner on your development machine, grab a stick help him to understand that this is a very bad idea ...
     
    holliebuckets likes this.
  3. Raidenwins

    Raidenwins

    Joined:
    Dec 18, 2012
    Posts:
    130
    Yes, I can confirm this is caused by McAfee. I've been using Unity (I am on version 4.1 now) for over a year and I never had any problems with it, until a few days ago, that is. McAfee started acting up that day, saying something about some IP trying to access my computer, even though the IP was that of my own machine. At about the same time I started getting the above error in Unity after making any change to any of my C# scripts. I Googled it and saw a few people saying it might be related to McAfee. So then I disabled the McAfee firewall and real-time scanning and the problem went away. On the next day though, it started happening again and nothing I did helped. The interesting thing was that my subscription to McAfee expired on that day, but when I looked at my machine's Services, several McAfee services were still running and I could not stop them. I tried running Unity as an administrator, as some people on the Internet had suggested that, but that didn't help either.

    At this time the error was happening after every single change I made to any C# script, so clearly, I could not do any development at all. Very frustrated, I resorted to the last measure I could think of, re-install McAfee from my machine and lo and behold, that fixed my problem. The error immediately went away.

    What I noticed before I un-installed McAfee was that every time I started up Unity, it would create that file, Assembly-CSharp-Editor.dll.mdb, in the Temp folder where my Unity project was. After I un-installed it though, that file was no longer being created.
     
    Sairyn, Ewh and Devanil like this.
unityunity