Embeddable document store on mono (Linux) doesn't work

171 views
Skip to first unread message

nickvane

unread,
Oct 16, 2013, 2:21:24 AM10/16/13
to rav...@googlegroups.com
Hi,

Initializing the embeddable document store on Mono (3.2.1) raises following exception:

System.IO.FileNotFoundException : Could not load file or assembly 'System.DirectoryServices.AccountManagement, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
at (wrapper managed-to-native) System.MonoType:GetPropertiesByName (System.MonoType,string,System.Reflection.BindingFlags,bool,System.Type)
at System.MonoType.GetProperties (BindingFlags bindingAttr) [0x00000] in /home/abuild/rpmbuild/BUILD/mono-3.2.1/mcs/class/corlib/System/MonoType.cs:312
at System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo+<GetExportMembers>c__Iterator3.MoveNext () [0x00110] in /home/abuild/rpmbuild/BUILD/mono-3.2.1/mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedPartCreationInfo.cs:358
at System.Linq.Enumerable.Any[MemberInfo] (IEnumerable`1 source) [0x00024] in /home/abuild/rpmbuild/BUILD/mono-3.2.1/mcs/class/System.Core/System.Linq/Enumerable.cs:138
at System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.HasExports () [0x00000] in /home/abuild/rpmbuild/BUILD/mono-3.2.1/mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedPartCreationInfo.cs:113
at System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.IsPartDiscoverable () [0x0001d] in /home/abuild/rpmbuild/BUILD/mono-3.2.1/mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedPartCreationInfo.cs:94
at System.ComponentModel.Composition.AttributedModel.AttributedModelDiscovery.CreatePartDefinitionIfDiscoverable (System.Type type, ICompositionElement origin) [0x0000a] in /home/abuild/rpmbuild/BUILD/mono-3.2.1/mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedModelDiscovery.cs:20
at System.ComponentModel.Composition.Hosting.TypeCatalog.get_PartsInternal () [0x00052] in /home/abuild/rpmbuild/BUILD/mono-3.2.1/mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/System/ComponentModel/Composition/Hosting/TypeCatalog.cs:276
at System.ComponentModel.Composition.Hosting.TypeCatalog.GetEnumerator () [0x00006] in /home/abuild/rpmbuild/BUILD/mono-3.2.1/mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/System/ComponentModel/Composition/Hosting/TypeCatalog.cs:234
at System.ComponentModel.Composition.Hosting.AssemblyCatalog.GetEnumerator () [0x00000] in /home/abuild/rpmbuild/BUILD/mono-3.2.1/mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/System/ComponentModel/Composition/Hosting/AssemblyCatalog.cs:562
at System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator27`2[System.ComponentModel.Composition.Primitives.ComposablePartCatalog,System.ComponentModel.Composition.Primitives.ComposablePartDefinition].MoveNext () [0x00059] in /home/abuild/rpmbuild/BUILD/mono-3.2.1/mcs/class/System.Core/System.Linq/Enumerable.cs:2302
at System.Linq.Enumerable.ToArray[ComposablePartDefinition] (IEnumerable`1 source) [0x0007c] in /home/abuild/rpmbuild/BUILD/mono-3.2.1/mcs/class/System.Core/System.Linq/Enumerable.cs:2899
at System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection+<Clear>c__AnonStorey26.<>m__40 () [0x00000] in /home/abuild/rpmbuild/BUILD/mono-3.2.1/mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/System/ComponentModel/Composition/Hosting/ComposablePartCatalogCollection.cs:112
at System.Lazy`1[System.Collections.Generic.IEnumerable`1[System.ComponentModel.Composition.Primitives.ComposablePartDefinition]].InitValue () [0x00083] in /home/abuild/rpmbuild/BUILD/mono-3.2.1/mcs/class/corlib/System/Lazy.cs:131
at System.Lazy`1[System.Collections.Generic.IEnumerable`1[System.ComponentModel.Composition.Primitives.ComposablePartDefinition]].get_Value () [0x00024] in /home/abuild/rpmbuild/BUILD/mono-3.2.1/mcs/class/corlib/System/Lazy.cs:100
at System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.RaiseChangedEvent (System.Lazy`1 addedDefinitions, System.Lazy`1 removedDefinitions) [0x0002e] in /home/abuild/rpmbuild/BUILD/mono-3.2.1/mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/System/ComponentModel/Composition/Hosting/ComposablePartCatalogCollection.cs:313
at System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.Clear () [0x000da] in /home/abuild/rpmbuild/BUILD/mono-3.2.1/mcs/class/System.ComponentModel.Composition.4.5/src/ComponentModel/System/ComponentModel/Composition/Hosting/ComposablePartCatalogCollection.cs:132
at Raven.Database.Config.InMemoryRavenConfiguration.FilterActiveBundles () [0x00000] in <filename unknown>:0
at Raven.Database.Config.InMemoryRavenConfiguration.PostInit () [0x00000] in <filename unknown>:0
at Raven.Database.Config.InMemoryRavenConfiguration.Initialize () [0x00000] in <filename unknown>:0
at Raven.Database.Config.RavenConfiguration.LoadConfigurationAndInitialize (IEnumerable`1 values) [0x00000] in <filename unknown>:0
at Raven.Database.Config.RavenConfiguration..ctor () [0x00000] in <filename unknown>:0
at Raven.Client.Embedded.EmbeddableDocumentStore.get_Configuration () [0x00000] in <filename unknown>:0
at Raven.Client.Embedded.EmbeddableDocumentStore.set_RunInMemory (Boolean value) [0x00000] in <filename unknown>:0
at Heuts.Api.Dal.UnitTests.BaseDalTestFixture.Setup () [0x00007] in /opt/TeamCity/buildAgent/work/50c844c5def0f779/Source/Heuts.Api.Dal.UnitTests/BaseDalTestFixture.cs:21
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00054] in /home/abuild/rpmbuild/BUILD/mono-3.2.1/mcs/class/corlib/System.Reflection/MonoMethod.cs:230

The code for the store configuration:

            var documentStore = new EmbeddableDocumentStore
            {
                RunInMemory = true,
                EnlistInDistributedTransactions = false
            };

            documentStore.RegisterListener(new NoStaleQueriesAllowed());
            documentStore.JsonRequestFactory.DisableRequestCompression = true;
            documentStore.Initialize();

For what I can make of the stacktrace, a plugin is loaded via MEF and that has a reference to System.DirectoryServices.AccountManagement, which obviously doesn't work on Linux.
In the bin folder we have following (relevant) dll:
  • raven.abstractions
  • raven.client.embedded
  • raven.client.lightweight
  • raven.database
  • microsoft.windowsazure.storage
  • microsoft.data.edm
  • microsoft.data.odata
This is ravendb v 2.5.2700, mono 3.2.1 on openSUSE 12.3, .net framework profile 4.5.
Any idea, which dll is causing this, or how we can work around this?

Kind regards, Nick

Mircea Chirea

unread,
Oct 16, 2013, 3:09:08 AM10/16/13
to rav...@googlegroups.com
The database isn't supported on Mono. Only the client library is.

nickvane

unread,
Oct 16, 2013, 4:00:51 AM10/16/13
to rav...@googlegroups.com
Yes, I know that is the official version.
We are only using the embeddable store for unit tests on the build server.
But I think it should work. The embeddable store doesn't use the essent storage engine, it's in memory configured. It has no configuration for authentication.
And from this answer from Oren: http://stackoverflow.com/questions/14194270/using-embedded-ravendb-cross-platform-net-mono-monotouch-monodroid it should work on Mono, but is not officially supported.
There also has been a lot of work from Rob Ashton in the past years to make it run on Mono.
So I'm not giving up so slowly :)

I also have a bunch of other dll's in the bin folder (servicestack, autofac, restsharp, ...). Maybe it's one of those that are loaded via MEF and requires the dependency?

Oren Eini (Ayende Rahien)

unread,
Oct 16, 2013, 5:11:13 AM10/16/13
to ravendb
Nick,
Yes, it should work. But we've done no real work to make sure it actually does work, even in in memory mode only.
In this case it looks like it chokes on some AD stuff.

Oren Eini
CEO
Hibernating Rhinos
Office:    +972-4-674-7811
Fax:       +972-153-4622-7811





--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Chris Marisic

unread,
Oct 16, 2013, 8:43:42 AM10/16/13
to rav...@googlegroups.com
obligatory PR accepted speech
Reply all
Reply to author
Forward
0 new messages