BUILD ERROR- Assembly -CSharp-firstpass.dll Could Not Be Found [HoloLens]

Hi all,
I am trying to build the example HoloLens project (tutorial here). I want to use the HoloLens Emulator to deploy and test this project.
When I try to deploy the solution to the Emulator using Visual Studio 2017, I get the following errors:

Severity    Code    Description    Project    File    Line    Suppression State
Error    CS0006    Metadata file 'D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\bin\x86\Release\Assembly-CSharp-firstpass.dll' could not be found    Assembly-CSharp    D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp\CSC    1    Active
Error    CS0006    Metadata file 'D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\bin\x86\Release\Assembly-CSharp-firstpass.dll' could not be found    ARH2    D:\ARH2\App\ARH2\CSC    1    Active
Error    CS0006    Metadata file 'D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp\bin\x86\Release\Assembly-CSharp.dll' could not be found    ARH2    D:\ARH2\App\ARH2\CSC    1    Active
Error        The command ""D:\ARH2\App\Unity\Tools\SerializationWeaver\SerializationWeaver.exe" "D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\bin\x86\Release\Unprocessed\Assembly-CSharp-firstpass.dll" "-pdb" "-verbose" "-unity-engine=D:\ARH2\App\ARH2\Unprocessed\UnityEngine.dll" "D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\obj\x86\Release\x86\Release" "-lock=D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\project.lock.json" "@D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\SerializationWeaverArgs.txt" "-additionalAssemblyPath=D:\ARH2\App\ARH2\Unprocessed" "-unity-networking=D:\ARH2\App\ARH2\Unprocessed\UnityEngine.Networking.dll"" exited with code 1.    Assembly-CSharp-firstpass    D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\Assembly-CSharp-firstpass.csproj    196

And the following in the ‘Output’ tab:

Restoring NuGet packages...
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'
1>------ Build started: Project: Assembly-CSharp-firstpass, Configuration: Release x86 ------
1>  Running SerializationWeaver...
1>  System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
1>     at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
1>     at UnityEditor.Scripting.Compilers.NuGetPackageResolver.Resolve()
1>     at Unity.NuGetAssemblyResolver..ctor(String projectLockFile)
1>     at usw.Weaver.ReaderParameters(String assemblyPath, ConversionOptions options)
1>     at usw.Weaver.Weave()
1>     at usw.Program.RunProgram(ConversionOptions options)
1>     at usw.Program.Main(String[] args)
1>D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\Assembly-CSharp-firstpass.csproj(196,5): error MSB3073: The command ""D:\ARH2\App\Unity\Tools\SerializationWeaver\SerializationWeaver.exe" "D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\bin\x86\Release\Unprocessed\Assembly-CSharp-firstpass.dll" "-pdb" "-verbose" "-unity-engine=D:\ARH2\App\ARH2\Unprocessed\UnityEngine.dll" "D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\obj\x86\Release\x86\Release" "-lock=D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\project.lock.json" "@D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\SerializationWeaverArgs.txt" "-additionalAssemblyPath=D:\ARH2\App\ARH2\Unprocessed" "-unity-networking=D:\ARH2\App\ARH2\Unprocessed\UnityEngine.Networking.dll"" exited with code 1.
2>------ Build started: Project: Assembly-CSharp, Configuration: Release x86 ------
2>CSC : error CS0006: Metadata file 'D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\bin\x86\Release\Assembly-CSharp-firstpass.dll' could not be found
3>------ Build started: Project: ARH2, Configuration: Release x86 ------
3>CSC : error CS0006: Metadata file 'D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\bin\x86\Release\Assembly-CSharp-firstpass.dll' could not be found
3>CSC : error CS0006: Metadata file 'D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp\bin\x86\Release\Assembly-CSharp.dll' could not be found
========== Build: 0 succeeded, 3 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========

I have used Unity 5.6.1f1, Unity 2017.1.0f3 and Unity 2017.1.0p3. I have removed and rebuilt the .sln file multiple times, even created multiple projects from scratch. The issue persists. I have looked at threads / solutions here, here and here and tried those but the issue is still there. Apparently I am doing something very wrong, because I have removed and reinstalled Unity, Visual Studio multiple times, I have renamed the project folder to not contain any spaces, I have tried to make the directory path shorter, put it closer to the root etc etc. What should I do to fix this issue?[quote]

[/quote]

I believe @Tautvydas-Zilys gave you the workaround in this post, is there something different about this post. I’m seeing a similar failure in the output tab.

Yes, I will try to use VS2015 and see if I can build correctly. Does it work for you?
Edit: Aside from the error mentioned in your post, I see those three additional errors as I wrote:

Error    CS0006    Metadata file 'D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\bin\x86\Release\Assembly-CSharp-firstpass.dll' could not be found    Assembly-CSharp    D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp\CSC    1    Active
Error    CS0006    Metadata file 'D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\bin\x86\Release\Assembly-CSharp-firstpass.dll' could not be found    ARH2    D:\ARH2\App\ARH2\CSC    1    Active
Error    CS0006    Metadata file 'D:\ARH2\App\GeneratedProjects\UWP\Assembly-CSharp\bin\x86\Release\Assembly-CSharp.dll' could not be found    ARH2    D:\ARH2\App\ARH2\CSC    1    Active

Well, if I try to open the sln file in VS 2015, it is asking me to update:[quote]
One or more projects are targeting the Windows 10 Creators Update platform which requires a newer version of Visual Studio. Learn how to upgrade to 15.0.25909.2.
[/quote].
I cannot find this particular version, and acoording to this post, I need to get VS 2017 to ensure compatibility with Windows 10 Creators Update - which I already have and don’t want to use.

In the Unity build window, select a Windows SDK that is order than 10.0.15063 - like 10.0.14393. VS 2015 does not support SDK 15063.

Thank you. It finally worked with VS 2015 and Windows SDK 10.0.14393

I am facing the same problem and unable to resolve since 3 days, i have used Unity 5.6.1f1, Unity 5.6.2f1, Unity 2017.1.0f3 and Unity 2017.1.0p3 and the new Unity 2017.2.0b10 (64-bit). I have removed and rebuilt the .sln file multiple times, even created multiple projects from scratch. The issue persists.

I have looked at threads / solutions here, and other forums and tried those but the issue is still there. 1 thing is for sure that i am not doing correct settings or something is very wrong, because I have reinstalled Unity, Visual Studio.

Finally it worked with VS 2015 SP3 and Windows SDK 10.0.14393

You could also use a combination of VS 2017 and Unity 2017 beta

If you import the Holotoolkit package, you should see a tab at the top of the unity editor that says “Holotoolkit” and it will set the settings for you automatically. Holotoolkit → configure and click on all of the different settings.

I imported the MRtoolkit-Unity but it does not show a “Holotoolkit”-tab

Details:
I’m using Unity 2017.2.0b11 and Mixed Reality Toolkit Unity dev 2017.2.0

That’s Interesting. I’m running 2017.1 and the same toolkit and I have a tab at the top in between window and component that says HoloToolkit. The toolkit might not be completely compatible with the beta I’m not sure.