This project is read-only.

Store call raise 'System.TypeLoadException' (SOLVED)

Apr 6, 2013 at 1:43 PM
Hi, the call to the Store method raise a strange exception when called by the ViewModel but non when called directly after the database Open.
Here is the exception message:
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
The call stack shosw a bunch of calls to the ObjectIntrospector.GetObjectInfo but unfortunately I cannot copy the entire call stack

Other info from the Debug Console:
A first chance exception of type 'System.TypeLoadException' occurred in mscorlib.dll
'ClientNotificator2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_it_b77a5c561934e089\mscorlib.resources.dll'
A first chance exception of type 'System.NullReferenceException' occurred in NDatabase3.dll
A first chance exception of type 'System.TypeLoadException' occurred in NDatabase3.dll
A first chance exception of type 'System.TypeLoadException' occurred in NDatabase3.dll
A first chance exception of type 'NDatabase.Exceptions.OdbRuntimeException' occurred in NDatabase3.dll
A first chance exception of type 'NDatabase.Exceptions.OdbRuntimeException' occurred in NDatabase3.dll
A first chance exception of type 'NDatabase.Exceptions.OdbRuntimeException' occurred in NDatabase3.dll
Any suggestions are appreciated.
Apr 6, 2013 at 4:05 PM
What about the logs in NDatabase ? Any possibility to attach sample app which has the same problem?

Thanks,
Jacek
Apr 6, 2013 at 5:02 PM
I've enabled the console logger and saved di output to file log.txt.
I think is in a sort of loop cause for a single insert the file is about 1,5 MB

Basically I try to store an object which inherit from ObservableObject from the mvvm-light toolkit

Unfortunately I cannot share the original code and the sample app shows a different error:
Object reference not set to an instance of an object.
   in System.Windows.Dependent.GetHashCode()
   in System.Collections.Generic.ObjectEqualityComparer`1.GetHashCode(T obj)
   in System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   in System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
   in NDatabase.Tool.Wrappers.OdbHashMap`2.TryGetValue(TKey key, TValue& v) in c:\TeamCity\buildAgent\work\9a4cd5884b729548\src\Tool\Wrappers\OdbHashMap2.cs:riga 81
Here is the full stack trace Stack Trace

Thanks,
Alessio
Apr 6, 2013 at 6:25 PM
Seems that I've found what is causing the error. Basically ObservableObject have some field that cause serialization troubles. Removing the inheritance ad pass to the Store method a plain object with simple property solved the problem.

Thanks for your time,
Alessio



alessiovertemati wrote:
I've enabled the console logger and saved di output to file log.txt.
I think is in a sort of loop cause for a single insert the file is about 1,5 MB

Basically I try to store an object which inherit from ObservableObject from the mvvm-light toolkit

Unfortunately I cannot share the original code and the sample app shows a different error:
Object reference not set to an instance of an object.
   in System.Windows.Dependent.GetHashCode()
   in System.Collections.Generic.ObjectEqualityComparer`1.GetHashCode(T obj)
   in System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   in System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
   in NDatabase.Tool.Wrappers.OdbHashMap`2.TryGetValue(TKey key, TValue& v) in c:\TeamCity\buildAgent\work\9a4cd5884b729548\src\Tool\Wrappers\OdbHashMap2.cs:riga 81
Here is the full stack trace Stack Trace

Thanks,
Alessio