我的项目中出现了一个特定的问题。我只找到了一个支持C#的库(在Xamarin中):Sharp.XMPP,NuGet,但我有麻烦。当我在分离的可移植类库中编写一些示例代码时,我会得到以下错误:
Error 1: '.ctor' is not supported by the language在线旁
using (XmppClient client = new XmppClient(hostname, username, password))
{
...
}下一步:
Error 2: Metadata file '...\Project.Jabber.dll' could not be found
Warnings 2-6: Reference to type 'System.Net.Security.RemoteCertificateValidationCallback' claims it is defined in 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile78\System.dll', but it could not be found c:\Users\Kliford\Downloads\S22.Xmpp\S22.Xmpp.dll 我毫无头绪。提前谢谢你。
发布于 2015-09-15 18:41:58
Sharp.Xmpp与PCL不兼容,因为它使用XmlElement类,目前PCL中没有这个类。
重写这个部分是可行的,但需要付出很大的努力。
我使用的解决方法是开发引用.Net 4.5的Sharp.XMPP类库。Windows和.Net之间的可移植性是通过Xamarin实现的。
希望这能有所帮助
发布于 2015-09-08 08:28:35
当较低的库使用不同版本的.NET框架时,也会发生这种情况。您尝试在您使用的.NET框架的相同版本上更新de库,并且它应该可以工作。
https://stackoverflow.com/questions/32396159
复制相似问题