"Assembly-CSharp-firstpass.dll could not be found." How to fix this compilation error?

The project— my very first—is a barebones one: “Holograms 100,” which is a Windows Dev Center tutorial. I planned to test it using Hololense Emulator (version 10.0.14393.1358).

I open MixedRealitySolution.sln in Visual Studio and attempt to compile it.

I repeatedly get message that “firstpass.dll” cannot be found; also that “Assembly-firstpass cannot be found. I did find the firstpass.dll in a folder called “Unprocessed;" it was only 4 kb.”

ERROR CS006: Metadata file 'C:\Users\Jumper\Documents\myUnity5\MixedRealityIntroduction\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\bin\x86\Release\Assembly-CSharp-firstpass.dll' could not be found

ERROR CS006: Metadata file 'C:\Users\Jumper\Documents\myUnity5\MixedRealityIntroduction\App\GeneratedProjects\UWP\Assembly-CSharp\bin\x86\Release\Assembly-CSharp.dll' could not be found

I am using Unity Beta version 2017.2.0b8 along with Visual Studio Community 2017 Version 15.3.2 (.NET Framework: 4.6.0138). My operating system is Windows 10 Professional: version 1511 (OS Build 10586.318). I had previously enabled Hyper-V in both BIOS and Windows.

In Unity, for the player properties that related to the settings for Universal Windows Platform, I did target Windows 10 SDK: for the rendering section. That is to say, I checked the Virtual Reality Supported checkbox to add a new Virtual Reality SDKs list and confirmed "Windows Mixed Reality" was listed as a supported SDK. That is to say, the Virtual Reality SDKs was set to Windows Holographic.

In Unity’s “Configuration” section:

Scripting Runtime version: Experimental (.NET 4.6 Equivalent); Visual Studio Community 2017 Version 15.3.2 uses .NET Framework: 4.6.0138. I also tried the only other choice of “Stable (.NET 3.5 Equivalent).

Scripting Backend: .NET

API Compatibility Level: .NET 4.6

In Unity’s “Build Settings:”

Platform: Universal Windows Platform

Target: Any Device

Build Type: D3D

Build and Run: Local Machine

Debugging: I checked “Unity C# Projects” only; also, I tried both “Unity C# Projects” and also “Development Build.”

SDK: Latest Installed (the only alternative was 10.0.15063.0). I did also try the alternate setting.

The relevant Visual Studio settings are as follows:

Solution configuration: Release

Solution platform: x86

Hololens Emulator 10.0.14393.1358


1, Several times, I repeated the tutorial from scratch, especially always double-checking that I made the correct property settings for the player, configuration and building.

  1. I reinstalled both Unity and Visual Studio Community.

  2. I placed solution in root folder of hard drive and opened Visual Studio; I thought perhaps problem accessing file path that was too long. There are no spaces or special characters in the original file path.

  3. In Visual Studio, I made sure, in Nuget Package Manager Settings, that in the Package Restore Section, both “Allow NuGet to download missing packages” and “Automatically check for missing packages during build in Visual Studio were checked. In another attempt at solving problem, I unchecked both of them, closed Visual Studio, then I relaunched program, re-checked the two items and attempted to compile.

  4. I have spent countless hours searching and trying likely solutions Unity and Microsoft sites, as well as various forums.

Please advise; I would be most appreciative.

Hi, can you post the contents of the output window in Visual Studio after the build fails?

I've been having the exact same problem.

I am using Unity 5.6.f1 and Visual Studio Professional 15.3.3.
I am having the exactly same issue and changing the player setting to .NET 2.0 does not work.

The following is VS2017's build output log:

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: Debug x86 ------
1> Running SerializationWeaver...
1> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
1> at System.ThrowHelper.ThrowKeyNotFoundException()
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:\Holograms\test0\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\Assembly-CSharp-firstpass.csproj(192,5): error MSB3073: The command ""D:\Holograms\test0\App\Unity\Tools\SerializationWeaver\SerializationWeaver.exe" "D:\Holograms\test0\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\bin\x86\Debug\Unprocessed\Assembly-CSharp-firstpass.dll" "-pdb" "-verbose" "-unity-engine=D:\Holograms\test0\App\test0\Unprocessed\UnityEngine.dll" "D:\Holograms\test0\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\obj\x86\Debug\x86\Debug" "-lock=D:\Holograms\test0\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\project.lock.json" "@D:\Holograms\test0\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\SerializationWeaverArgs.txt" "-additionalAssemblyPath=D:\Holograms\test0\App\test0\Unprocessed" "-unity-networking=D:\Holograms\test0\App\test0\Unprocessed\UnityEngine.Networking.dll"" exited with code 1.
2>------ Build started: Project: Assembly-CSharp, Configuration: Debug x86 ------
2>CSC : error CS0006: Metadata file 'D:\Holograms\test0\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\bin\x86\Debug\Assembly-CSharp-firstpass.dll' could not be found
3>------ Build started: Project: test0, Configuration: Debug x86 ------
3>CSC : error CS0006: Metadata file 'D:\Holograms\test0\App\GeneratedProjects\UWP\Assembly-CSharp-firstpass\bin\x86\Debug\Assembly-CSharp-firstpass.dll' could not be found
3>CSC : error CS0006: Metadata file 'D:\Holograms\test0\App\GeneratedProjects\UWP\Assembly-CSharp\bin\x86\Debug\Assembly-CSharp.dll' could not be found
========== Build: 0 succeeded, 3 failed, 0 up-to-date, 0 skipped ==========

You're hitting this: https://forum.unity3d.com/threads/net-scripting-backend-and-visual-studio-2017-3-incompatibility.487833/