PrecompiledAssemblyException: Multiple precompiled assemblies with the same name websocket-sharp.dll

为了使用LTS,我把Unity版本改为2018大中华区增强版,然后遇到了一个傻问题

PrecompiledAssemblyException: Multiple precompiled assemblies with the same name websocket-sharp.dll included for the current platform. Only one assembly with the same name is allowed per platform. Assembly paths: D:/**/Library/PackageCache/com.unity.messenger@1.0.7-preview/Editor/Third-Party/websocket-sharp.dll, Assets/common/libs/websocket-sharp.dll
UnityEditor.Scripting.ScriptCompilation.EditorBuildRules.CreateTargetAssemblies (System.Collections.Generic.IEnumerable`1[T] customScriptAssemblies, System.Collections.Generic.IEnumerable`1[T] precompiledAssemblies) (at D:/unity/Editor/Mono/Scripting/ScriptCompilation/EditorBuildRules.cs:251)
UnityEditor.Scripting.ScriptCompilation.EditorCompilation.UpdateCustomTargetAssemblies () (at D:/unity/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:627)
UnityEditor.Scripting.ScriptCompilation.EditorCompilation.SetAllCustomScriptAssemblyJsons (System.String[] paths) (at D:/unity/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:737)
UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface.SetAllCustomScriptAssemblyJsons (System.String[] allAssemblyJsons) (at D:/unity/Editor/Mono/Scripting/ScriptCompilation/EditorCompilationInterface.cs:217)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at D:/unity/Modules/IMGUI/GUIUtility.cs:179)

大概意思是我引用的dll与编辑器引用的dll冲突了,那么好了,我自己删掉,用你的!不行,脚本编译都过不了。

 

解决方案1:缺点:编辑器自带的dll版本很低,很多新方法不支持

1、找到Library\PackageCache\com.unity.messenger@1.0.7-preview\Editor\Third-Party中的dll,替换我的dll

2、websocket-sharp.dll 改成  websocket-sharp1.dll 

如果不操作第一步,会有个版本冲突的报错

Library\PackageCache\com.unity.messenger@1.0.7-preview\Editor\Scripts\Utils\WebSocketExtension.cs(9,50): error CS0433: The type 'WebSocket' exists in both 'websocket-sharp, Version=1.0.1.0, Culture=neutral, PublicKeyToken=5660b08a1845a91e' and 'websocket-sharp, Version=1.0.2.59611, Culture=neutral, PublicKeyToken=5660b08a1845a91e'

 

解决方案2:缺点:每次新编译都需要操作下,因为是临时文件,版本管理上很头疼

删除Library\PackageCache\com.unity.messenger@1.0.7-preview\Editor\Third-Party中的dll

 

解决方案3:反馈给unity,我已经反馈了一次了,希望大家一起DDS反馈

©️2020 CSDN 皮肤主题: 像素格子 设计师:CSDN官方博客 返回首页