我一直在使用RavenDB兩個小時,所以如果我錯過了一些顯而易見的道歉。序列化/反序列化系統.Uri
我使用System.Uri類型的屬性存儲非規範化視圖模型。 URI是序列化爲一個字符串,它是好,我猜,但引發此異常,當我加載文檔:
Message=Could not cast or convert from System.String to System.Uri.
Source=Newtonsoft.Json
StackTrace:
at Newtonsoft.Json.Utilities.ConvertUtils.EnsureTypeAssignable(Object value, Type initialType, Type targetType) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Utilities\ConvertUtils.cs:line 267
at Newtonsoft.Json.Utilities.ConvertUtils.ConvertOrCast(Object initialValue, CultureInfo culture, Type targetType) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Utilities\ConvertUtils.cs:line 244
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 544
Uri在數據庫中看起來像什麼? – ataddeini 2012-04-21 14:15:40
「Url」:「/ about-us」 – 2012-04-21 14:16:57