Search Unity

[Solved] UnauthorizedAccessException on Networking.xml

Discussion in 'Scripting' started by Palimon, Jun 30, 2015.

  1. Palimon

    Palimon

    Joined:
    Apr 18, 2013
    Posts:
    225
    [SOLVED] - Unsure what the deal was. I just removed all the network-related components, added them back in, and the error is gone.

    I just jumped into using 5.1's UNET, and I'm getting an error after the most basic additions to my scene (adding a NetworkManager object with NetworkManager and NetworkManagerHUD, adding the player prefab, etc. I'm not really sure what could do this, and it's happening on Unity load. Here's the full error:

    UnauthorizedAccessException: Access to the path "Library\UnityAssemblies\UnityEngine.Networking.xml" is denied.
    System.IO.File.Delete (System.String path) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/File.cs:179)
    SyntaxTree.VisualStudio.Unity.Bridge.Project.SafeDelete (System.String file)
    SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilesGenerator.CleanDeployPath ()
    SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilesGenerator.DeployUnityAssemblies (SyntaxTree.VisualStudio.Unity.Bridge.ProjectSystem.UnitySolution solution)
    SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilesGenerator.GenerateProject ()
    SyntaxTree.VisualStudio.Unity.Bridge.Project+<>c__DisplayClass3.<RunOnceOnUpdate>b__2 ()
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:264)
     
    Last edited: Jun 30, 2015
  2. risokncn

    risokncn

    Joined:
    Oct 14, 2013
    Posts:
    20
    It happens every time I change my build settings from Android to PC. The error occurs just after I start the scene. I haven't found other solution than restarting my pc yet, if you have one, plz lmk.

    [Note: I am using UnityVS, maybe the problem is there?]
     
  3. Palimon

    Palimon

    Joined:
    Apr 18, 2013
    Posts:
    225
    I don't have any great wisdom to pass on - at one point while rebooting Unity and/or my PC, the error just disappeared. Sorry :/
     
  4. eisenpony

    eisenpony

    Joined:
    May 8, 2015
    Posts:
    974
    In The OPs stack trace, the failing operation is a delete. Since restarting your computer seems to help my guess is that some process is hanging onto a file handle and preventing that file from being deleted. You could try shutting down any apps you have open which might be holding that file.

    If you really want to find out what's causing the issue & you are on Windows, get a copy of process monitor and put a filter on that file's path. You can see which process is trying to do which operations and what the result is.
     
  5. risokncn

    risokncn

    Joined:
    Oct 14, 2013
    Posts:
    20
    [Solved] restarting VS helped in my case