KeyNotFoundException after Rebuild (SOLVED)

Mar 8, 2013 at 2:40 PM
I have an issue where performing a Rebuild of my Solution causes an exception when I call OdbFactory.Open. Here is what I've found:
  1. If I start with no database created, the application opens fine.
  2. As long as I keep using the same version of the application, the application opens fine.
  3. As soon as I do a Rebuild Solution, I can no longer open the database. I receive a KeyNotFoundException (stack trace below) when performing CheckMetaModelCompatibility.
  4. One issue may be that my assembly version configuration is set to "1.3.*", which means that subsequent builds will have different full names for the assemblies, given the inclusion of version number. I suspect this is what's causing problems when trying to validate that the currently loaded types match the types found in the database.
  5. I've enabled logging and the last entry in the log before the exception is "ObjectReader: Current Meta Model is :System.Collections.Generic.Dictionary`2+ValueCollection[System.String,NDatabase.Odb.Core.Layers.Layer2.Meta.ClassInfo]"
  6. On a side note, I notice that the database is registering type information for "System.Reflection.RtFieldInfo" and a bunch of other System.Reflection and System.Runtime classes. I'm not sure if this is expected or if one of my classes is somehow causing these to be referenced.
Any help would be greatly appreciated. This database solution is much cleaner and more lightweight than what I was using previously and I'd really like to get this to work.

Stack Trace:

at System.Collections.Generic.Dictionary2.get_Item(TKey key)
at NDatabase.Odb.Core.Layers.Layer3.Engine.StorageEngine.CheckMetaModelCompatibility(IDictionary
2 currentCIs) in c:\TeamCity\buildAgent\work\5f9a44f79ee7a25c\src\Odb\Core\Layers\Layer3\Engine\StorageEngine.cs:line 111
at NDatabase.Odb.Core.Layers.Layer3.Engine.StorageEngine..ctor(IDbIdentification parameters) in c:\TeamCity\buildAgent\work\5f9a44f79ee7a25c\src\Odb\Core\Layers\Layer3\Engine\StorageEngine.cs:line 88
at NDatabase.Odb.Main.Odb..ctor(String fileName) in c:\TeamCity\buildAgent\work\5f9a44f79ee7a25c\src\Odb\Main\Odb.cs:line 14
at NDatabase.Odb.Main.Odb.GetInstance(String fileName) in c:\TeamCity\buildAgent\work\5f9a44f79ee7a25c\src\Odb\Main\Odb.cs:line 26
at NDatabase.Odb.OdbFactory.Open(String fileName) in c:\TeamCity\buildAgent\work\5f9a44f79ee7a25c\src\Odb\OdbFactory.cs:line 22
Coordinator
Mar 8, 2013 at 6:47 PM
Could you please rise the issue (http://ndatabase.codeplex.com/workitem/list/basic), additionally it would be great if you could attach sample project which contains the mentioned issue.

Many thanks,
Jacek
Coordinator
Mar 9, 2013 at 6:15 PM
Please check with refreshed NDatabase 3.5 version, if everything works well now.

Thanks,
Jacek