Create store from types in external assemblies

Feb 1, 2013 at 6:13 PM
Edited Feb 1, 2013 at 6:18 PM
I'm trying to create a Store and discover it's Entities from types in another assembly.
What I'm doing is: Create a stripped .dll only with interfaces and classes and then I try to create a Store for the types in this assembly.
SqlCeDataStore store = new SqlCeDataStore("SomeName.sdf");
In the AddType method from the DataStore I'm getting a FormatException when the method is trying to get all the field definitions:
File or assembly name 'System.Data, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089', or one of its dependencies, was not found.

That assembly I'm trying to load has only one class with everything set up properly.

Any ideas?

P.S. Smart Device -> WindowsCE project :D

If I move that class into the executing assembly and load it from there it works. But I want to have a definitions assembly which should be a part of my greater overall BL

Feb 1, 2013 at 6:17 PM
The public key token 'B77A5C561934E089' is the destop public key. That means that the assembly you're trying to load (BL.Definitions.dll) has a reference to the desktop System.Data assembly. You can't load desktop assemblies on a CE device. You need to create a "BL.Definitions.dll" assembly for the Compact Framework and load it.
Feb 1, 2013 at 6:54 PM
Edited Feb 1, 2013 at 6:54 PM
many many thanks... stupid of me to miss that.

it works like a charm.