views:

88

answers:

2

Hi.

I had an old (but great) app using NHibernate 1.0.2. Worked like a charm. But then I decided to upgrade to NHibernate 2.1.2. Had to change some stuff, worked great also.

Problem is, I founded out that new version works in some machines and do not work in others. What the heck? Thinking a while, I discovered that it only works in pcs with SQL 2000 installed!! previous version used to works everywhere.... Check out a piece of my exception, it has to do with mssql2000Dialect

NHibernate.MappingException: Could not compile the mapping document: Datos.NH_VEN_ComprobanteBF.hbm.xml ---> NHibernate.HibernateException: Could not instantiate dialect class NHibernate.Dialect.MsSql2000Dialect ---> System.Reflection.TargetInvocationException: Se produjo una excepción en el destino de la invocación. ---> System.TypeInitializationException: Se produjo una excepción en el inicializador de tipo de 'NHibernate.NHibernateUtil'. ---> System.TypeLoadException: No se puede cargar el tipo 'System.DateTimeOffset' del ensamblado'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
   en NHibernate.Type.DateTimeOffsetType.get_ReturnedClass()
   en NHibernate.NHibernateUtil..cctor()
   --- Fin del seguimiento de la pila de la excepción interna ---
   en NHibernate.Dialect.Dialect..ctor()
   en NHibernate.Dialect.MsSql2000Dialect..ctor()
   --- Fin del seguimiento de la pila de la excepción interna ---
   en System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
   en System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)

Could you help? Thanks!!!!

A: 

Actually, I had to install Framework 3.5. Then it worked.

I do not recall haveng seen fw3.5 as a requirement in nhibernate site.

thank guys!!!

Daniel Dolz
+1  A: 

The problem's to do with DateTimeOffset - you need .Net 3.5 Or .Net 2.0 SP1 (thanks dan) installed for this.

(No se puede cargar el tipo 'System.DateTimeOffset' del ensamblado'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')

David Kemp
Actually, no. FW 3.5 is not neccesary. You just need Framework 2.0 SP1, which allows me to make it work in Windows 2000. Apparently, it also ships with Framework 3.5, that was what disoriented me.Jon Skeet gave me the answer, thanks Jon
Daniel Dolz
Thanks Dan - I did not know that.
David Kemp