xamarin构建在模拟器上通过,但在真实设备上失败 [英] xamarin build pass on simulator but fails on real device
问题描述
我正在使用xamarin创建跨平台的应用程序.我的Android版本在模拟器和真实设备上都能很好地工作. ios版本仅在模拟器中有效.当我尝试在真实设备上调试时,出现此错误
I am creating an app using xamarin to be cross plateform. My android version works well on a simulator and a real device. The ios version works only in the simulator. When I try to debug on a real device I get this error
错误MT2002:无法从"mscorlib,版本= 4.0.0.0,区域性=中性,公共密钥令牌= b77a5c561934e089"(MT2002)解析"System.Reflection.Emit.DynamicMethod"引用
Error MT2002: Failed to resolve "System.Reflection.Emit.DynamicMethod" reference from "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" (MT2002)
注意更多...
推荐答案
实际上出现了问题,因为我在PCL项目中添加了对WebSocket4Net的引用.由于android应用以及Iphone模拟器仍在运行,我认为一切正常.
Actually the issue appeared, since I added reference to WebSocket4Net in my PCL project. As the android app was still working, and also the Iphone simulator, I assumed that everything was ok.
我发现对于Android和Ios,存在特定的二进制文件或WebSocket4Net.因此,我只是在IOS项目中添加了对WebSocket4Net nuget包的引用,该应用程序现在也可以在我的设备上运行.
I figured out that there are specific binaries or WebSocket4Net for Android and Ios. So I simply added reference to the WebSocket4Net nuget package in the IOS project, and the app works now on my device also.
感谢您的帮助和解答.
这篇关于xamarin构建在模拟器上通过,但在真实设备上失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!