本文介绍了Hololens 构建失败 - 命令 AssemblyConverter.exe 以代码 1 退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

命令C:TestFileHoloBuildVSAppUnityToolsAssemblyConverter.exe"-platform=uap -lock=C:TestFileHoloBuildVSAppHoloBuildproject.lock.json"-bits=32 -configuration=Debug -removeDebuggableAttribute=False -uwpsdk=10.0.15063.0 -path=."-path=C:Program FilesUnityEditorDataPlaybackEnginesMetroSupportPlayersUAPdotnetx86Debug";C:TestFileHoloBuildVSAppHoloBuildAssembly-CSharp.dll"C:TestFileHoloBuildVSAppHoloBuildUnityEngine.dll"C:TestFileHoloBuildVSAppHoloBuildUnityEngine.Analytics.dll"C:TestFileHoloBuildVSAppHoloBuildunit.framework.dll"C:TestFileHoloBuildVSAppHoloBuildUnityEngine.UI.dll"C:TestFileHoloBuildVSAppHoloBuildUnityEngine.HoloLens.dll"C:TestFileHoloBuildVSAppHoloBuildUnityEngine.Networking.dll"C:TestFileHoloBuildVSAppHoloBuildUnityEngine.VR.dll""退出代码 1. HoloBuild C:TestFileHoloBuildVSAppHoloBuildHoloBuild.csproj 292

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

I have this error in the build output :

1>System.Collections.Generic.KeyNotFoundException:字典中不存在给定的键.(任务 ID:275)

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

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

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

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

1>在 Unity.UWPAssemblyResolver..ctor(String projectLockFile, String requiredUWPSDKVersion) (TaskId:275)

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

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

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

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

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

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

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

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

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

1>在 Unity.Program.Main(String[] args) (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.

正如某些线程中所建议的,我尝试删除并重新添加一些引用,尝试在 Unity 中弄乱一些构建设置.

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

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

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 ?

推荐答案

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

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.

以下是相关链接:

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

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

希望这有帮助!

这篇关于Hololens 构建失败 - 命令 AssemblyConverter.exe 以代码 1 退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 00:27