NUnit and the app.config

My blog has moved. You can read the post here: NUnit and the app.config

Advertisements

16 Responses to “NUnit and the app.config”

  1. John-Daniel Trask Says:

    Hi David, great to see a new blog pop up – especially one touching on O/R Mapping.

    I’ve been experimenting with nHibernate lately and quite enjoying it – it seems like it needs a bit better community around it (it gets drowned out by the hibernate folks! :-))

    This is mostly just a “pop in to say hi” message. I look forward to seeing your future entries.

    – JD

  2. David Givoni Says:

    Hi John-Daniel,

    I’m surprised, but glad to see that someone already found the blog, since I haven’t done anything to “show it off” yet, hehe.
    Thanks for the message, I just had a look at your own blog and it seems very interesting, I’ll take a deeper look later today.

    /David

  3. David Givoni Says:

    Ok, I just had a look at the referrers (stilll getting to know the wordpress engine) and found out that my friend Tim Haines posted a notice about me going online. Now I understand where you came from, John-Daniel.
    Thanks, Tim 🙂

  4. Nic Wise Says:

    David,

    Any comments on building your NHibernate config files? I’ve tried the Matsoft tool, but while it was good, doing M-N relationships was, well, fun…

    Any thoughts on things to use? or examples of each kind of relationship (1-1, 1-N, M-N, M-1 etc)

    Cheers

    Nic

  5. David Givoni Says:

    Hi Nic,

    I tried Matsoft too, but got exception-errors several times and gave it up.
    Instead I have tried CodeSmith and MyGeneration. I’m about to write a small entry on it now. Both worked ok for me.

    Cheers,
    David

  6. David Givoni’ blog » Blog Archive » O/R Mappers and automatic code generation Says:

    […] Inspired by Nic Wise’s question regarding how I generate the mapping files for NHibernate, I wanted to write a bit about my experience with automatic code generation tools and O/R Mappers. This is not a discussion of O/R Mappers versus automatic code generation, but my own experience on how to combine the two. […]

  7. Russ Barber Says:

    Just wanted to say thanks for publishing the solution. I ran into this problem today and tried all sorts of things(app.config,hibernate.cfg.xml, myapp.dll.config) to get to work. Now’s it’s working fine that’s to you. It took me awhile but now that I’ve got nhibernate up and running it’s sure worth the effort.

  8. Don Demsak Says:

    One of the things I tell folks to do when using NUnit is to add a prebuild event to their Test Project (if it is a dll) that contains the following command: copy /Y “$(ProjectDir)app.config” “$(TargetPath).config”

    This way, every time you do a build, it will copy over the app.config file, and rename it for you. Unfortunately, in VS 2003, pre and post build events are only available to C# projects. To accomplish the same thing using VB, you have to download some additional VS extensions and even then, the build events are in the solution file, not the project file. This has been fixed in VS 2005.

  9. David Givoni Says:

    Yes, Don, I actually also had a build-event to do this automatically.
    But this didn’t work in my case.
    It only works in the first case, as far as I found out, that is if you didn’t create a project in NUnit, but just load the dll to test.

  10. Chris Lennon Says:

    I am curious to know why you selected SQLite and how you found it (speed, any bugs, easy to work with etc)

  11. David Givoni Says:

    Hi Cris,

    Sorry I’ve been so late at responding to this, I simply forgot and havent been able to blog much lately.
    Anyway to answer your questions, what I needed was a database to be able to distribute with the application without having to install anything “extra” on the client machine that was using the application. It’s a non-internet based windows application.
    I found SQLLite to be a bit difficult to use. Let me say though that my experience was from november/december 2005, so it might be slightly out of date.
    First of all the only interface is text-based, so the whole database structure has to be created with sql statements. This just takes longer time than with a visual based application as visual studio.net. And reviewing information int the database is the same way. What is a bigger problem though, is that it doesn’t support the “ALTER TABLE” statement, so every time you have to change the structure of a table, you have to delete it and create it again. Also there are no relationship contraints, so you have to be very sure that you don’t create inconsistent data!
    I was considering using MS Access at first, but at that moment the support for it in NHibernate was pretty bad, now it’s better though. I also looked at Firebird, but that requires a separate installation of the database.
    I think at this moment I would go for Access if I had to choose again although there is the issue with licensing that has to be considered as well.

    Hope this answers your question, and again sorry for having forgotten to answer before.

    /David

  12. Antonio del Pozzo Says:

    Hi David,
    I’m newbie about NHibernate and NUnit. Do you know how debug NUnit test on NHibernate? I get an example from internet and I try to run with NUnit. I use your suggest about .config and it works. But on a test I get a fail, I dont know why and I would debug them. I use VS 2003.

  13. David Givoni Says:

    Hi Antonio,

    I’m glad my suggestion worked for you too.
    In order to help you with your problem, could you post your test code and give some more details on what goes wrong?

    /David

  14. Mihailo Says:

    Hi David,
    I just ran into similar problem. By looking at your blog entry I solved the problem very quickly. Also I found out that you do not need to name your config file NUnitProjectName.config, that is you can change it by following Project/Edit… menu option, and then at General tab you can change Configuration File Name property to any config file you want.
    Off to solving other problems 😉

    Mihailo

  15. Greg Lucy Says:

    Thanks for the solution to this problem!

    Greg

  16. David Givoni’s Blog » Blog Archive » O/R Mappers and automatic code generation Says:

    […] Inspired by Nic Wise’s question regarding how I generate the mapping files for NHibernate, I wanted to write a bit about my experience with automatic code generation tools and O/R Mappers. This is not a discussion of O/R Mappers versus automatic code generation, but my own experience on how to combine the two. […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: