And yes, this is filed under Linq as well.

And yes, this is filed under Linq as well.

I read that and I nearly laughed out loud. My cube neighbors would have thought I was not working hard and was maybe watching YouTube.

I’ve been thinking for a while that NHibernate or Castle’s ActiveRecord coupled with NHibernate Query Generator looks like “Linq today”, or maybe even “Better than Linq”. I think maybe it should have been filed under Linq and “Better than Linq”.

I’ve been using Castle under Mono and tried to get NQG running under mono. NQG has some Visual Studio extension options, so compiling it with Mono isn’t as easy as using xbuild (mono’s msbuild). I slapped together this two line Makefile which does build.
<code>
QueryGenerator: QueryGenerator.cs AssoicationBehavior.cs CustomTool/BaseCodeGenerator.cs CustomTool/IObjectWithSite.cs CustomTool/IOleServiceProvider.cs CustomTool/IVsGeneratorProgress.cs CustomTool/IVsSingleFileGenerator.cs CustomTool/ServiceProvider.cs Program.cs Properties/AssemblyInfo.cs QueryBuilders/QueryBuilder.cs <br/>
gmcs -resource:QueryBuilders/QueryBuilder.cs -resource:QueryBuilders/QueryBuilder.vb -reference:../../../../castle/bin/Castle.ActiveRecord.dll -reference:../../SharedLibs/NHibernate/NHibernate.dll QueryGenerator.cs AssoicationBehavior.cs CustomTool/BaseCodeGenerator.cs CustomTool/IObjectWithSite.cs CustomTool/IOleServiceProvider.cs CustomTool/IVsGeneratorProgress.cs CustomTool/IVsSingleFileGenerator.cs CustomTool/ServiceProvider.cs Program.cs Properties/AssemblyInfo.cs QueryBuilders/QueryBuilder.cs<br/>
</code>
It just leaves out the files which have the Microsoft.VisualStudio.Designer stuff in them. The command line app still works.

Unfortunately, when executing I get a NullReferenceException from Mono.Xml.Schema.XmlSchemaValidatingReader.get_Prefix. I think I’ve run into a part of the BCL which Mono has not entirely implemented. I haven’t had time to dive into the Mono source to figure this out. I’ll add this to my todo list 🙂

Thanks to Ayende (Oren) for the “Better than Linq”.

powered by performancing firefox

2 thoughts on “And yes, this is filed under Linq as well.”

  1. Does Mono have any compiler defines that I can use?
    If so, I’ll just move the VS stuff to #if
    Also, the XmlValidator is work-aroundable – it means that the app may fail with a cryptic message on bad files, but that is all.

  2. I found this in the NOTES section of the mcs man page

    During compilation the MCS compiler defines the __MonoCS__ sym-
    bol, this can be used by pre-processor instructions to compile
    Mono C# compiler specific code. Please note that this symbol
    is only to test for the compiler, and is not useful to distin-
    guish compilation or deployment platforms.

    While Mono does work on Windows, I’m not sure that Microsoft.VisualStudio.* will ever be in the Mono gac. While one could use the mono compiler and run on .net on win32, i don’t think it is a very common use case. Using this define is probably a good solution.

Comments are closed.