在存储实现INotifyPropertyChanged
接口或包含任何事件的对象时,通常会出现以下异常:
NDatabase.Exceptions.OdbRuntimeException:
NDatabase has thrown an Exception
Error:275:Class Introspectpr error for class MS.Internal.Text.TextInterface.Generics.NativeIUnknownWrapper<MS::Internal::Text::TextInterface::Native::IDWriteFont>, PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 ---> NDatabase.Exceptions.OdbRuntimeException:
NDatabase has thrown an Exception
Error:275:Class Introspectpr error for class MS.Internal.Text.TextInterface.Generics.NativeIUnknownWrapper<MS::Internal::Text::TextInterface::Native::IDWriteFont>, PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 ---> NDatabase.Exceptions.OdbRuntimeException:
NDatabase has thrown an Exception
Error:275:Class Introspectpr error for class MS.Internal.Text.TextInterface.Generics.NativeIUnknownWrapper<MS::Internal::Text::TextInterface::Native::IDWriteFont>, PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 ---> System.TypeLoadException: Could not load type from string value 'MS.Internal.Text.TextInterface.Generics.NativeIUnknownWrapper<MS::Internal::Text::TextInterface::Native::IDWriteFont>, PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at NDatabase.TypeResolution.GenericTypeResolver.Resolve(String typeName) in c:\TeamCity\Agents\A\BuildAgent\work\5f9a44f79ee7a25c\src\TypeResolution\GenericTypeResolver.cs:line 44
首次存储对象或更新现有对象时会发生这种情况
我使用此代码来存储对象:
long newid = 0;
using (var db = NDatabase.OdbFactory.OpenLast())
{
newid = db.Store(st).ObjectId;
}