Search Unity

System.Exception: Package directory not found

Discussion in 'Windows' started by SynchroAR, Aug 29, 2017.

  1. SynchroAR

    SynchroAR

    Joined:
    Dec 7, 2016
    Posts:
    6
    Hi!

    In the Unity editor I am getting this following error:

    System.Exception: Package directory not found: "C:\Users\Joshua Choi\.nuget\packages\Microsoft.CSharp\4.0.0".
    at UnityEditor.Scripting.Compilers.NuGetPackageResolver.Resolve () [0x000e7] in <1df528c4ff9a4140955a16cd6dc04d46>:0
    at AssemblyUpdater.Core.AssemblyUpdaterContext.AddFrameworkFolderToSearchPath (Mono.Cecil.AssemblyDefinition assemblyDefinition, Mono.Cecil.DefaultAssemblyResolver resolver, APIUpdater.Framework.Log.IAPIUpdaterListener listener) [0x000eb] in <1df528c4ff9a4140955a16cd6dc04d46>:0
    at AssemblyUpdater.Core.AssemblyUpdaterContext.ReadAssembly (System.String assemblyPath, APIUpdater.Framework.Log.IAPIUpdaterListener listener, System.IO.FileAccess mode, System.String[] searchPaths) [0x00086] in <1df528c4ff9a4140955a16cd6dc04d46>:0
    at AssemblyUpdater.Core.AssemblyUpdaterContext.From (System.String assemblyPath, APIUpdater.Framework.Configuration.IConfigurationProvider configuration, System.String[] assemblySearchPaths, AssemblyUpdater.Core.UpdaterMode mode, APIUpdater.Framework.Log.IAPIUpdaterListener listener) [0x0002b] in <1df528c4ff9a4140955a16cd6dc04d46>:0
    at AssemblyUpdater.Core.AssemblyUpdaterContext.From (System.String assemblyPath, System.String[] assemblySearchPaths, AssemblyUpdater.Core.UpdaterMode mode, APIUpdater.Framework.Log.IAPIUpdaterListener listener) [0x00001] in <1df528c4ff9a4140955a16cd6dc04d46>:0
    at AssemblyUpdater.Application.Program.CheckForObsoleteAPIUsage (AssemblyUpdater.Application.CommandLineSpec config) [0x00013] in <1df528c4ff9a4140955a16cd6dc04d46>:0
    at AssemblyUpdater.Application.Program.Main (System.String[] args) [0x00057] in <1df528c4ff9a4140955a16cd6dc04d46>:0
    UnityEditor.DockArea:OnGUI()



    Is this critical?
    Do I need to install Nuget packages? If I need to, can someone provide a basic guideline of how to install Nuget packages please?

    Thanks!


    Joshua Choi
     
  2. DrunkReaperMatt

    DrunkReaperMatt

    Joined:
    Feb 11, 2013
    Posts:
    38
    do you have visual studio installed and set a your default IDE for unity?
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Are you getting any previous error messages? Unity is supposed to install these packages automatically. Something is going wrong there.
     
  4. GGeff

    GGeff

    Joined:
    Nov 11, 2014
    Posts:
    40
    I'm having the same issue. During the Unity 2017 install, I did not include MS Visual Studio 2017 community (was unchecked by default) as I preferred to continue to use VS 2015, which worked fine for Unity version 5.x

    Edit: It seems this only occurs the first time you run Unity after upgrading to 2017. After closing and restarting the issue is no longer there.
     
    Last edited: Sep 7, 2017
  5. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    I having the same issue too, i upgraded from Unity 5.6 to 2017.2 now i got a pile of errors on top of that.

    Also another error is "WebSocket" could not be found and another is
    System.InvalidOperationExeception: Operation is not valid due to the current state of the object
    NullReferenceException: from TMPro.TMP_Settings.get_defaultFontAsset()


    These errors happen just by opening my old 5.6 project with Unity 2017.2 without even running anything
     
  6. Xelnath

    Xelnath

    Joined:
    Jan 31, 2015
    Posts:
    402
    This is happening to me too
     
  7. ramJat

    ramJat

    Joined:
    Jun 12, 2018
    Posts:
    14
    Any solution this is happening to me too.
    System.Exception: Package directory not found: "C:\Users\RChoudharyX098698\.nuget\packages\Microsoft.CSharp\4.0.1".
    at UnityEditor.Scripting.Compilers.NuGetPackageResolver.Resolve () [0x000dd] in <3f368bacb6c34f4db5fe7e90570f303a>:0
    at AssemblyUpdater.Core.AssemblyUpdaterContext.AddFrameworkFolderToSearchPath (Mono.Cecil.AssemblyDefinition assemblyDefinition, Mono.Cecil.DefaultAssemblyResolver resolver, APIUpdater.Framework.Log.IAPIUpdaterListener listener) [0x000eb] in <3f368bacb6c34f4db5fe7e90570f303a>:0
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Can you try creating an empty Unity project, switching to UWP, setting scripting backend to .NET, building the project and then coming back to your project and building as you did before?

    In either case, can we get a bug report on this?
     
  9. ramJat

    ramJat

    Joined:
    Jun 12, 2018
    Posts:
    14
    Its happening only first time when me import holotool kit into empty project. If i clear this error its goes off and it never come back.
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    First time in that project or first time on a machine? Can we get a bug report regardless?
     
  11. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,976
    This is still happening. Can someone confirm if this is holotoolkit or unity problem, instead of playing blame ping-pong?

    Everytime single time something like this is raised on the HTK github (anything vaguely related to unity at all), its said "unity issue" without trying to fix it. Getting very annoying considering we paid $5k for dev kits, would like some real support.

    Here is a good example of this:

    https://github.com/Microsoft/MixedRealityToolkit-Unity/issues/2296

    You can see its listed as external unity bug. But this is not an acceptable "resolution".

    @StephenHodgson-Valorem


    FYI this ONLY happens with HTK. So I severely doubt it is a "unity external" issue as it is listed as. Hence my observation of "blame ping pong". We have run API updater on a ton of things, only the holotoolkit struggles.
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    This is most definitely a bug in Unity, but as I mentioned before, we need a bug report for this. Forums are not a good place to report bugs because we cannot track them properly.

    EDIT: actually I found this: https://issuetracker.unity3d.com/issues/dot-netcore-5-uwp-dll-throws-exception-when-api-updater-runs

    I'm trying to find out why it was resolved as by design - looks like bunch of miscommunication. I'll post an update once I get to the bottom of this.

    EDIT2: I reactivated the bug and we will look into it. Thanks for bringing it to my attention.
     
    isidro02139 likes this.
  13. sbagchi

    sbagchi

    Joined:
    Nov 15, 2016
    Posts:
    4