2>CSC : error CS0006: Metadata file ‘D:\Documents\Unity\testnuget\WindowsStoreApp\GeneratedProjects\UWP\Assembly-CSharp-firstpass\bin\x86\Debug\Assembly-CSharp-firstpass.dll’ could not be found

3>—— Build started: Project: testnuget, Configuration: Debug x86 ——

3>CSC : error CS0006: Metadata file ‘D:\Documents\Unity\testnuget\WindowsStoreApp\GeneratedProjects\UWP\Assembly-CSharp-firstpass\bin\x86\Debug\Assembly-CSharp-firstpass.dll’ could not be found

3>CSC : error CS0006: Metadata file ‘D:\Documents\Unity\testnuget\WindowsStoreApp\GeneratedProjects\UWP\Assembly-CSharp\bin\x86\Debug\Assembly-CSharp.dll’ could not be found

And the VS error window looks like this:

It’s actually a dumb problem, but since I’ve been struggling with it for days, I’m hoping blogging about it will save you a few hours of head banging.

The best clue to what’s going on is the reference to the missing project.lock.json file. This is a nuGet file and somewhere in the HoloLens documentation it mentions that a HoloLens app built with Unity requires some nuget files in order to work.

In Visual Studio I went to Tools | Options | NuGet Package Manager and discovered that I had NuGet configured incorrectly in my shiny new VS install. I’m not totally sure why. By not allowing NuGet packages to be automatically downloaded, my HoloLens app was missing required files.

Both Allow NuGet to download missing packages and Automatically check for missing packages should have been selected.

After that, HoloLens builds have been working for me and I have been able to start deploying apps again.