Subscribe to
Posts
Comments

Everytime I try and get Ayende’s NHibernate Query Analyzer to work I seem to encounter some weirdness. Here’s what I did to get it running this time.

  1. Download the version appropriate to your version of NHibernate. For me, that was 1.2GA
  2. Create a new app.config file, and into it place just the NHibernate configuration section and the appropriate settings. Note that when I tried it, NQA didn’t like the <hibernate-configuration> notation for the hibernate section, instead I had to change it to use the <nhibernate> notation.
  3. Load up NQA and start a new project.
  4. Add the app.config file you created and the assemblies which contain your embedded HBM files.
  5. Hit Build Project. IMPORTANT! If you see any errors, then quit NQA, fix the errors, and start again. If you leave NQA running and try again you’ll see the same error message as it seems NQA doesn’t close the old app domain properly.
  6. If all that works, then your home dry. File, New Query, and off you go. Brilliant tool once it’s going.

3 Responses to “Getting NHibernate Query Analyzer to work”

  1. on 02 Nov 2008 at 4:57 pmDavid Brett

    Hi,

    Glad to see I’m not the only one trying to get this tool running. Your comments have enabled me to pass the build stage but I still can’t run a query.

    Always the same message : “in expected : (possibly invalid or unmapped class…”

    I’m wondering if my app.config is ok. Any chance I could see how you configured yours.

    This tool looks great if only i could get it to work!

    Cheers,

    David BRETT

  2. on 03 Nov 2008 at 11:20 amalpriest

    Hi David,

    Here’s my a link to my app.config. In my experience that error normally occurs if you’ve forgotten to mark your HBM files as embedded resources in Visual Studio, or you’ve not added the correct assembly (the one with the HBM files in) to your project.

  3. on 03 Nov 2008 at 2:08 pmDavid Brett

    Hi Al,

    thanks for your rapid reply however only the first line of your app.config file appeared in your answer.

    I have however now got the Analyzer working correctly.
    In my query I had omitted to refrence my classes using the appropiate namespace.

    Thanks anyway,

    David

Leave a Reply