Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 ?

like image 505
Pierre P. Avatar asked Aug 25 '17 08:08

Pierre P.


1 Answers

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!

like image 88
kudo Avatar answered Nov 11 '22 18:11

kudo