leancloud / realtime-SDK-dotNET

LeanCloud Instants Messaging SDK for Portable & Unity & .NET Core written by c#
Apache License 2.0
13 stars 9 forks source link

websocket-sharp #50

Open DengWang opened 6 years ago

DengWang commented 6 years ago

websocket-sharp是使用的这个库吗https://github.com/sta/websocket-sharp 为什么自己编译的 dll,无法运行,报这种错误 FileNotFoundException: Could not load file or assembly 'websocket-sharp' or one of its dependencies. The system cannot find the file specified. at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity) [0x0007b] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/AppDomain.cs:692 at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName,System.Security.Policy.Evidence) at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/AppDomain.cs:657 at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName) at System.Reflection.Assembly.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/Assembly.cs:589 at AssemblyLister.Lister.DeepWalkReferences (System.Reflection.Assembly assembly, System.Collections.Generic.HashSet1 seen) [0x00000] in <filename unknown>:0 at AssemblyLister.Lister+<>c__DisplayClass1_0.<get_AllAssemblies>b__0 (System.Reflection.Assembly asm) [0x00000] in <filename unknown>:0 at System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator122[System.Reflection.Assembly,System.Reflection.Assembly].MoveNext () [0x00000] in :0 at System.Linq.Enumerable+cIterator12`2[System.Reflection.Assembly,LeanCloud.Storage.Internal.AVModuleAttribute].MoveNext () [0x00000] in :0 at System.Linq.Enumerable+cIterator102[LeanCloud.Storage.Internal.AVModuleAttribute,System.Type].MoveNext () [0x00000] in <filename unknown>:0 at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D1[System.Type].MoveNext () [0x00000] in :0 at LeanCloud.Storage.Internal.AVModuleController.ScanForModules () [0x00000] in :0 at LeanCloud.AVClient..cctor () [0x00000] in :0 Rethrow as TypeInitializationException: An exception was thrown by the type initializer for LeanCloud.AVClient at LeanCloud.AVInitializeBehaviour.Initialize () [0x00000] in :0 at LeanCloud.AVInitializeBehaviour.Awake () [0x00000] in :0

aisk commented 6 years ago

是的。看报错日志:

FileNotFoundException: Could not load file or assembly 'websocket-sharp' or one of its dependencies. The system cannot find the file specified.

似乎是你没有把这个 dll 放到项目的依赖中。

DengWang commented 6 years ago

我是单独 Build 这个 dll 然后在 Unity 里替换了你们提供的那个,你说的依赖是指LeanCloud.Realtime.dll 这个也要重新生成吗

Borluse commented 6 years ago

你那个dll在inspector里有没有在editor下成功的include? image

DengWang commented 6 years ago

是包含的呀,我只替换了dll,其他设置都是一样的

DengWang commented 6 years ago

我可以提供我 Build 的 dll 文件 websocket-sharp.dll.zip

Borluse commented 6 years ago

确实是这样,我替换成你的build也出现这个问题了

DengWang commented 6 years ago

这是什么情况,是我 Build 的 dll 有问题吗?不知道要如何 Build 才没问题

Borluse commented 6 years ago

这就不知道,我没有build过这个dll。话说你为什么要自己build?

DengWang commented 6 years ago

自己 Build 调试方便些,不知道这个 dll你们是怎么处理的

Borluse commented 6 years ago

就直接用的他们sdk里的dll。

aisk commented 6 years ago

能否尝试一下从 NuGet 下载一下原作者的 build,看看是否有问题?https://www.nuget.org/packages/WebSocketSharp ,页面右边的 Manual download 可以下载。

DengWang commented 6 years ago

从NuGet 下的包导进去运行也是一样错误,只有你们提供的 dll 没有问题

aisk commented 6 years ago

有些奇怪,我去调查一下问题在哪,感谢汇报问题🙏