You are here: Platform Specific Issues > db4o On Mono

db4o On Mono

Currently db4o is only build for .NET and tested on .NET. However it's possible to use db4o on Mono. Some features are not supported on Mono: The data services and the monitoring-support.

In the regular build, db4o also uses some API's which are not available on Mono. To avoid that, you need to build db4o from source and define the build constant 'Mono'. The source is in the 'src'-folder of the db4o distribution.

Build For Mono With Regular .NET

The easiest way to build db4o for Mono is actually to use the regular MSBuild and just define the 'Mono' built-time constant. Open the Windows console and navigate to the db4o source folder. Then you can run the MSBuild command:

MSBuild /property:Configuration=Release /property:DefineConstants="Mono" /target:Rebuild Db4o-2008.sln

The MSBuild-tool is in the C:\Windows\Microsoft.NET\Framework\{version}\-folder, where the {version} represents the .NET version. For example 'v3.5' for .NET 3.5.

The different solution-files (*.sln) represent different versions of db4o. For example:

Solution-File db4o Version
Db4o-2005.sln db4o for .NET 2.0 / Mono equivalent
Db4o-2008.sln db4o for .NET 3.5 / Mono equivalent
Db4o-2010.sln db4o for .NET 4.0 / Mono equivalent
Db4o-CF-2005.sln db4o for .NET 2.0 Compact Framework
Db4o-CF-2008.sln db4o for .NET 3.5 Compact Framework
Db4o-Silverlight-2008.sln db4o for Silverlight 3.0 / Moonlight 3.0
Db4o-Silverlight-2010.sln db4o for Silverlight 3.0 / Moonlight 3.0

Note that you should use the MSBuild-tool for the right version. Use the MSBuild 3.5 version to build the Db4o-2008.sln Solution.

The result of the builds are in the bin/Release-folders of the different subprojects.

Build With Mono

In Mono you can use the xbuild-command instead of the MSBuild. The xbuild is part of the mono distribution. If you're using a Mono version which was packaged with your Linux-distribution, you maybe need to install is separately.

In principal the command is exactly the same as with MSBuild and the same rules apply. The different solution-files represent the different db4o versions. See on the table above.

xbuild /property:Configuration=Release /property:DefineConstants="Mono" /target:Rebuild Db4o-2008.sln

When you build with Mono and xbuild, you probably get some errors.This errors should be only in following projects.

The rest of db4o can be built on Mono. The result of the builds are in the bin/Release-folders of the different subproject's.