System.Exception: Package directory not found

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

do you have visual studio installed and set a your default IDE for unity?

Are you getting any previous error messages? Unity is supposed to install these packages automatically. Something is going wrong there.

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.

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

This is happening to me too

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

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?

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.

First time in that project or first time on a machine? Can we get a bug report regardless?

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:

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.

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: Unity Issue Tracker - .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.

1 Like

I had a similar error and found these instructions which fixed it for me. Hope it helps someone.