Hololens Build Failing - The command AssemblyConverter.exe exited with code 1
Asked Answered
P

2

5

After updating to the latest version of VS 2017 (version 15.3.2) my Hololens builds generated from Unity keep failing with this message :

The command ""C:\TestFile\HoloBuild\VSApp\Unity\Tools\AssemblyConverter.exe" -platform=uap -lock="C:\TestFile\HoloBuild\VSApp\HoloBuild\project.lock.json" -bits=32 -configuration=Debug -removeDebuggableAttribute=False -uwpsdk=10.0.15063.0 -path="." -path="C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Players\UAP\dotnet\x86\Debug" "C:\TestFile\HoloBuild\VSApp\HoloBuild\Assembly-CSharp.dll" "C:\TestFile\HoloBuild\VSApp\HoloBuild\UnityEngine.dll" "C:\TestFile\HoloBuild\VSApp\HoloBuild\UnityEngine.Analytics.dll" "C:\TestFile\HoloBuild\VSApp\HoloBuild\nunit.framework.dll" "C:\TestFile\HoloBuild\VSApp\HoloBuild\UnityEngine.UI.dll" "C:\TestFile\HoloBuild\VSApp\HoloBuild\UnityEngine.HoloLens.dll" "C:\TestFile\HoloBuild\VSApp\HoloBuild\UnityEngine.Networking.dll" "C:\TestFile\HoloBuild\VSApp\HoloBuild\UnityEngine.VR.dll"" exited with code 1. HoloBuild C:\TestFile\HoloBuild\VSApp\HoloBuild\HoloBuild.csproj 292

I have this error in the build output :

1> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. (TaskId:275)

1> at System.Collections.Generic.Dictionary`2.get_Item(TKey key) (TaskId:275)

1> at UnityEditor.Scripting.Compilers.NuGetPackageResolver.Resolve() (TaskId:275)

1> at Unity.UWPAssemblyResolver..ctor(String projectLockFile, String desiredUWPSDKVersion) (TaskId:275)

1> at Unity.OperationContext.SetPlatform(Platform platform, String projectLockFile, String uwpSDK) (TaskId:275)

1> at Unity.ParseArgsStep.Execute() (TaskId:275)

1> at Unity.Step.Execute(OperationContext operationContext, IStepContext previousStepContext) (TaskId:275)

1> at Unity.Operation.Execute() (TaskId:275)

1> at Unity.Program.Main(String[] args) (TaskId:275)

I have tried with many fresh projects but the result is the same with the same error message.

As suggested in some threads, I tried removing and adding back some references, tried messing with some build settings in Unity.

I'm not sure at all that this issue is because of updating Visual Studio. Has anyone faced the same issue ? How may I be able to build my projects ?

Pyrrhotite answered 25/8, 2017 at 8:54 Comment(1)
The error "The command [...] exited with code 1." is a generic error. All it's basically saying is "the compiler failed to compile the project." The giant glob of text is literally just the parameters passed to the compiler and of no help. The rest of that (starting with the "KeyNotFoundException") is an indication that something is wrong with your install. It may be that Unity 2017 can't do HoloLens compile, it could be a package failed to install correctly, I am not sure.Glomerule
Q
5

This problem is related to a bug in Unity that makes it not work with Visual Studio 2017 (15.3). Here are some links regarding it. I believe you can install a Unity patch, but the easiest solution I found was to downgrade Visual Studio to the 2015 version. If you have access to Visual Studio 2017 (15.2) that would work as well.

Here are the related links:

  1. https://forum.unity3d.com/threads/net-scripting-backend-and-visual-studio-2017-3-incompatibility.487833/

  2. https://forum.unity3d.com/threads/build-error-assembly-csharp-dll-could-not-be-found-hololens.458493/

Hope this helps!

Quincunx answered 26/8, 2017 at 1:7 Comment(0)
Q
0

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 https://forum.unity3d.com/threads/build-error-assembly-csharp-firstpass-dll-could-not-be-found-hololens.488357/

Quorum answered 10/9, 2017 at 15:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.