Xamarin.Forms项目中的MissingMethodException

时间:2017-09-11 15:13:40

标签: c# .net xamarin xamarin.forms

我正在使用Xamarin.Forms开发一个应用程序。我有一个方法,它将给定对象的所有属性作为字符串返回。

import re
rx = r"\"?([-a-zA-Z0-9.`?{}]+@\w+(?:-\w+)*\.\w+)\"?"
s = """ "bilgi@kleintoys.com"  and bilgi@klei-ntoys.com"""
print(re.findall(rx, s)) 
# => ['bilgi@kleintoys.com', 'bilgi@klei-ntoys.com']

在iOS和UWP上运行正常,但在访问给定对象的public static string GetAllProperties(this object obj) { return string.Join(" ", obj .GetType() .GetRuntimeProperties() .Select(prop => prop.GetValue(obj))); } 属性时会在Android上抛出MissingMethodException

IsTransient

我尝试了以下但没有运气。

  • 清理解决方案并重新启动Visual Studio。
  • 将PCL项目的.NET框架从4.5.1更改为4.6(项目属性>库>定位>更改...),但即使列出了4.6,也不允许我选择它。
  • 确保在每个平台项目上安装最新版本的Xamarin NuGet软件包。

我认为这不会有助于诊断问题,但我在PCL项目中安装了以下NuGet包。

  • Firebase.Xamarin
  • Humanizer
  • Microsoft.Bcl
  • Microsoft.Bcl.Build
  • Microsoft.Net.Http
  • Newtonsoft.Json
  • PCLAppConfig
  • PCLStorage
  • Rx-Core,Rx接口,Rx-Linq,Rx-Main,Rx-PlatformServices
  • Xamarin表格

平台项目只安装了Xamarin软件包。

0 个答案:

没有答案