Hololens 构建失败 - 命令 AssemblyConverter.exe 已退出,代码为 1

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

更新到最新版本的 VS 2017(版本 15.3.2)后,我从 Unity 生成的 Hololens 构建一直失败并显示此消息:

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

我在构建输出中有这个错误:

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)

我尝试了很多新的项目,但结果是一样的,但出现相同的错误消息。

正如某些主题中所建议的那样,我尝试删除并添加回一些引用,尝试在 Unity 中弄乱一些构建设置。

我完全不确定这个问题是因为更新 Visual Studio。 有没有人遇到过同样的问题? 我怎样才能构建我的项目?

此问题与 Unity 中的一个错误有关,该错误导致它无法与 Visual Studio 2017 (15.3) 一起使用。这里有一些关于它的链接。我相信您可以安装 Unity 补丁,但我找到的最简单的解决方案是将 Visual Studio 降级到 2015 版本。如果您有权访问 Visual Studio 2017 (15.2),那也可以。

相关链接如下:

  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/

希望对您有所帮助!

我遇到了同样的问题,3 天后无法解决,我使用了 Unity 5.6.1f1、Unity 5.6.2f1、Unity 2017.1.0f3 和 Unity 2017.1.0p3 以及新的 Unity 2017.2.0b10 (64 -少量)。我多次删除并重建了 .sln 文件,甚至从头开始创建了多个项目。问题仍然存在。

我查看了此处和其他论坛的主题/解决方案并尝试了这些,但问题仍然存在。 1 可以肯定的是我没有做正确的设置或者有什么是非常错误的,因为我已经重新安装了 Unity,Visual Studio.

最终它与 VS 2015 SP3 和 Windows SDK 10.0.14393 一起工作 https://forum.unity3d.com/threads/build-error-assembly-csharp-firstpass-dll-could-not-be-found-hololens.488357/