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

UnauthorizedAccessException after installing Visual Studio Tools for Unity

Discussion in 'Code Editors & IDEs' started by Antistone, May 13, 2015.

  1. Antistone

    Antistone

    Joined:
    Feb 22, 2014
    Posts:
    2,833
    I recently installed the Visual Studio Tools for Unity following these instructions. (Using VS 2013 Community Edition and Unity 5.0.0f4 personal.)

    After installing, Unity seems to be successfully generating a VS solution file and opens VS when I double-click a script in the Unity editor, as expected. However, I'm frequently getting this error:

    UnauthorizedAccessException: Access to the path "Library\UnityAssemblies\UnityEngine.xml" is denied.

    This error doesn't actually seem to prevent anything from working correctly, but it's popping up when Unity compiles my code, when I run my project in the editor, or when I build a standalone version.

    Any idea what would be causing this error or how to resolve it?
     
  2. wkwan

    wkwan

    Joined:
    Sep 14, 2014
    Posts:
    27
    I've seen this before, it usually goes away after restarting Unity. Have you tried that? Otherwise you could try deleting the Library folder, Unity will regenerate it.
     
  3. Antistone

    Antistone

    Joined:
    Feb 22, 2014
    Posts:
    2,833
    Restarting Unity did not fix it, but restarting both Unity and Visual Studio seems to have done so.
     
  4. art_craft_vlad

    art_craft_vlad

    Joined:
    May 26, 2015
    Posts:
    8
    I am having the same issues using the same versions as the original poster.
    Restarting the editor and VS may help in the short term, but issue comes back later. Does anyone knows the cause to it and/or permanent solution? Could that be related to antivirus locking the file?
     
  5. blueknee

    blueknee

    Joined:
    Apr 5, 2014
    Posts:
    8
    Same problem here. I'm investigating why this happens for the last couple of weeks and with no luck.