"Type RuntimeClass cannot be serialized" Windows Phone 上的 HTTPClient 异常
"Type RuntimeClass cannot be serialized" exception with HTTPClient on Windows Phone
我有一个应用程序,在登录页面切换到菜单页面后,如果我按下 "start" 按钮,就会出现异常。我使用 HTTPClient
class 登录。我只在登录后得到异常。
这是我在按下 "start":
时得到的异常
{"Type 'System.Runtime.InteropServices.WindowsRuntime.RuntimeClass' cannot be serialized.
Consider marking it with the DataContractAttribute attribute,
and marking all of its members you want serialized with the DataMemberAttribute attribute.
Alternatively, you can ensure that the type is public and has a parameterless constructor -
all public members of the type will then be serialized, and no attributes will be required."}
似乎在您登录后尝试使用运行时 class 序列化对象(例如 SolidColorBrush),您可以使用 [IgnoreDataMember] 属性忽略这些属性。
我有一个应用程序,在登录页面切换到菜单页面后,如果我按下 "start" 按钮,就会出现异常。我使用 HTTPClient
class 登录。我只在登录后得到异常。
这是我在按下 "start":
时得到的异常{"Type 'System.Runtime.InteropServices.WindowsRuntime.RuntimeClass' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required."}
似乎在您登录后尝试使用运行时 class 序列化对象(例如 SolidColorBrush),您可以使用 [IgnoreDataMember] 属性忽略这些属性。