Upon importing MRT in 2017.4.5f1 LTS I am returned the following:
System.Exception: Package directory not found: "....nugetpackagesMicrosoft.CSharp4.0.1".
No console errors returned
console error returned
2017.4.5f1
2017.4.0.0
This happens because of an issue with Unity's API updater process.
When you open a project Unity runs the API updater on your source and on all the DLLs and if needed applies automatic "fixes" to them. It seems for each DLL it processes it assumes you have all the dependencies already downloaded in your nuget cache, but doesn't retrieve them if not.
The full error I was seeing was:
Error: System.Exception: Package directory not found:
"C:Users\[username]\.nugetpackagesMicrosoft.CSharp4.0.1".
at UnityEditor.Scripting.Compilers.NuGetPackageResolver.Resolve () [0x000dd]
I reported this to Unity and they pointed me at this year old known issue:
https://issuetracker.unity3d.com/issues/dot-netcore-5-uwp-dll-throws-exception-when-api-updater-runs
Maybe one day they will fix it... for now its non-fatal, just annoying.
We were having this problem on our build servers and the error was failing our builds. If that is your case you can use the command line parameter -disable-assembly-updater
Fix: Just install the package in Visual Studio using Package Manager Console.
PM> Install-Package Microsoft.CSharp -Version 4.0.1
@rperreta I have tried to install the package as you mentioned
Install-Package : Could not install package 'Microsoft.CSharp 4.0.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v3.5,Profile=Unity Subset v3.5', but the package does not contain any assembly references
or content files that are compatible with that framework. For more information, contact the package author.
My settings are similar to yours.
If I ignore the error message and continue with the tutorial at https://docs.microsoft.com/en-us/windows/mixed-reality/holograms-210 and try to run the scene by pressing the play button, it shows some other compiler error. I managed to solve them by adding an input manager and basic cursor. However, the play button do not show the scene. It only show a black screen. Any comments on that?
@reillydonovan did you able to solve the problem?
Bulk closing older HTK bug. Please reopen if you can repro this issue in MRTK v2.
Thanks!
Yoyo
This error also won't affect build
Most helpful comment
Fix: Just install the package in Visual Studio using Package Manager Console.
PM> Install-Package Microsoft.CSharp -Version 4.0.1