Runtime error when trying to run Fluent NHibernate tutorial example

前端 未结 4 2166
夕颜
夕颜 2020-12-12 02:45

I worked through the Fluent NHibernate tutorial at http://wiki.fluentnhibernate.org/Getting_started and the project compiles fine.

However, I am getting a runtime

相关标签:
4条回答
  • 2020-12-12 03:27

    You may also need:

    • Castle.Core.dll
    • Castle.DynamicProxy2.dll
    0 讨论(0)
  • 2020-12-12 03:32

    Just because your fluent NHibernate project compiles, that doesn't mean that your mapping is correct.

    The outer exception (to do with the FluentNHibernate assembly could be a red herring).

    Try commenting out all of your nhibernate mapping except the simplest, easiest bit - and see if it works then. If it does, gradually uncomment things until you find the bit that fails.

    0 讨论(0)
  • 2020-12-12 03:34

    Download the Fluent NHibernate source distribution, then take a look at the example projects; you can then compare the references those projects have to the ones yours has.

    0 讨论(0)
  • 2020-12-12 03:37

    I feel like an idiot for this but at the end of the day the mapping problem was caused by the fact that I had named the project FluentNHibernate (in my own defense it was in a SAMPLES folder) but that was causing the mapping to fail.

    Internally Visual Studio defaulted the Assembly name to FluentNHibernate and that was causing the runtime error. Renaming the assembly to ConsoleApplication fixed it.

    Seth

    0 讨论(0)
提交回复
热议问题