Accessing Persistent Classes From Different .NET Applications

This topic applies to .NET version only 

Problem

Accessing db4o database created and filled in with a .NET application or library from another .NET application or library shows an empty database.

Reason

db4o class name format in db4o consists of the full class name and assembly name:

Namespace.ClassName, AssemblyName

Two different .NET applications (libraries) usually have different assembly names. If you do not use aliasing, the class name will be appended with the current application assembly name.

Solution

In order to access db4o persistent classes from different applications (libraries) you will need to use an Alias. For example:

Application1.exe ("Application1" assembly):

objectContainer.Set(new MyClasses.Pilot("David Barrichello",99))

// internally the class is saved as "MyClasses.Pilot, Application1".

Application2.exe ("Application2" assembly):

For more information see Class Name Format In .NET and Aliases.