更新到最新版本的VS 2017 (版本15.3.2) 后,从Unity生成的Hololens builds一直失败,并显示以下信息:
"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"
在build输出中发现以下错误:
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中的一些构建设置进行调整。
"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"
在build输出中发现以下错误:
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引起的。 有人遇到过相同的问题吗? 我该如何构建我的项目?
The command [...] exited with code 1.
"是一个通用的错误。它基本上是在说"编译器无法编译项目"。那一大堆文本实际上只是传递给编译器的参数,没有任何帮助。其余部分(从"KeyNotFoundException
"开始)表明您的安装存在问题。可能是Unity 2017无法进行HoloLens编译,也可能是某个包未能正确安装,我不确定。 - Draco18s no longer trusts SE