Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

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

Discussion in '2017.2 Beta' started by trosoft, Aug 26, 2017.

  1. trosoft

    trosoft

    Joined:
    Aug 26, 2017
    Posts:
    1
    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


    MY CORRECTIVE MEASURES:

    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.

    2. I reinstalled both Unity and Visual Studio Community.

    3. 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.

    4. 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.

    5. 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.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Hi, can you post the contents of the output window in Visual Studio after the build fails?
     
  3. EvalDaemon

    EvalDaemon

    Joined:
    Aug 8, 2013
    Posts:
    107
    I've been having the exact same problem.
     
  4. PanamaCityFSU

    PanamaCityFSU

    Joined:
    Jul 31, 2017
    Posts:
    3
    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.
     
  5. PanamaCityFSU

    PanamaCityFSU

    Joined:
    Jul 31, 2017
    Posts:
    3
    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 ==========
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680