Daniel Dolz
Daniel Dolz

Reputation: 2421

NHibernate 2.1 MsSql2000Dialect error

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!!!!

Upvotes: 1

Views: 493

Answers (2)

kͩeͣmͮpͥ ͩ
kͩeͣmͮpͥ ͩ

Reputation: 7846

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')

Upvotes: 1

Daniel Dolz
Daniel Dolz

Reputation: 2421

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!!!

Upvotes: 0

Related Questions