Thanks a lot! This works perfect! I added a line System.Environment.SetEnvironmentVariable("OS", "linux")
Do you know how to file a bug to the developers?! Thanks & Regards, Johannes Johannes von Drachenfels Phone: +49-7231-9223800 Mobile: +49-171-6710815 Drachenfels GmbH Bleichstrasse 56 75173 Pforzheim Germany Geschäftsführer: Johannes von Drachenfels Sitz der Gesellschaft: Pforzheim Handelsregister: Registergericht Mannheim: HRB 504389 Notice: This transmittal and/or attachments may be privileged or confidential. If you are not the intended recipient, you are hereby notified that you have received this transmittal in error; any review, dissemination, or copying is strictly prohibited. If you received this transmittal in error, please notify us immediately by reply and immediately delete this message and all its attachments. Thank you. -----Ursprüngliche Nachricht----- Von: news [mailto:n...@ger.gmane.org] Im Auftrag von Robert Jordan Gesendet: Mittwoch, 9. Dezember 2009 15:17 An: lucene-net-user@incubator.apache.org Betreff: Re: System.TypeInitializationException on linux (vbnc) On 09.12.2009 14:57, Johannes Drachenfels wrote: > Hi, > > > > sorry for re-posting - I am new to this list... > > > > I am switching from lucene.net 2.0.0.4 to lucene.net 2.9.1.1 and I have > problems in a very early state. > > > > With version 2.0.0.4 it works fine! > > With version 2.9.1.1 on Microsoft it works fine > > With version 2.9.1.1 on linux I always get the following errors: > > > > ################################ > > System.TypeInitializationException: An exception was thrown by the type > initializer for Lucene.Net.Store.FSDirectory ---> > System.TypeInitializationException: An exception was thrown by the type > initializer for Lucene.Net.Util.Constants ---> > System.NullReferenceException: Object reference not set to an instance > of an object > > at Lucene.Net.Util.Constants..cctor () [0x00000] > > --- End of inner exception stack trace --- > > at Lucene.Net.Store.FSDirectory..cctor () [0x00000] > > --- End of inner exception stack trace --- > > at ConsoleApplication1.Module1.Main () [0x00000] This is probably caused by this line in Lucene.Net.Util.Constants.cs: public static readonly System.String OS_NAME = System.Environment.GetEnvironmentVariable("OS"); Try to assign some value to the env var "OS": OS=foo mono yourapp.exe Robert