Make sure that you have following dlls copied to the output folder and loaded by w3wp.exe (if you use IIS):
- NHibernate.ByteCode.Castle.dll
- Castle.Core.dll
- NHibernate.dll
- Iesi.Collections.dll
- log4net.dll
And your NHibernate configuration has this line:
<property name="proxyfactory.factory_class">
NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle
</property>
As an option, you can try to upgrade to latest version of NHibernate - 3.2. They have a built in proxy generator so it should be simpler for you. You will not need these additional dlls. Just remove the config line above if you use NHibernate 3.2.
If for some reasons you can not upgrade to 3.2 you may consider using different byte code providers. NHibernate supports 3 of them out of the box. Try LinFu or Spring:
NHibernate.ByteCode.Castle.ProxyFactoryFactory
- NHibernate.ByteCode.LinFu.ProxyFactoryFactory
- NHibernate.ByteCode.Spring.ProxyFactoryFactor