[英]Error converting value “AAAAAAAAB9c=” to type 'System.Version'. Path 'version'
Whenever I try to access my Azure Mobile Service table, I get the following error: 每当我尝试访问Azure移动服务表时,都会出现以下错误:
An exception of type 'Newtonsoft.Json.JsonSerializationException' occurred in mscorlib.ni.dll but was not handled in user code mscorlib.ni.dll中发生了类型为'Newtonsoft.Json.JsonSerializationException'的异常,但未在用户代码中处理
Additional information: Error converting value "AAAAAAAAB9k=" to type 'System.Version'. 附加信息:将值“ AAAAAAAAB9k =”转换为类型'System.Version'时出错。 Path 'version', line 19, position 27. 路径“版本”,第19行,位置27。
This is the line where this error occurred: 这是发生此错误的行:
await App.MobileService.GetTable<TodoItem>().InsertAsync(todoItem);
I don't actually need the version value in my table. 我实际上不需要表中的版本值。 This value is automatically generated by Azure. 该值由Azure自动生成。 Is there a way to force ignore the version value? 有没有办法强制忽略版本值?
This is the TodoItem definition: 这是TodoItem定义:
public class TodoItem
{
public string Id { get; set; }
public DateTime createdAt { get; set; }
public DateTime updatedAt { get; set; }
public Version version { get; set; }
public bool deleted { get; set; }
... and so on...
}
Your TodoItem code is wrong. 您的TodoItem代码错误。 It should be something like: 应该是这样的:
[Version]
public string Version {get; set;}
Here [Version] references VersionAttrbute that is located in the Microsoft.WindowsAzure.MobileServices namespace. 这里[Version]引用位于Microsoft.WindowsAzure.MobileServices命名空间中的VersionAttrbute。
I would avoid using System.Version
for this purpose. 我将避免为此目的使用System.Version
。 System.Version
is for numeric version values such as software releases that following this pattern: wxyz
. System.Version
用于数字版本值,例如遵循此模式的软件发行版: wxyz
。 It looks like you are receiving a string that can't fit that, nor do I expect you to. 看来您收到的字符串不合适,也不希望您这样做。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.