These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: MsSqlServer200xDialect Exception
PostPosted: Mon Dec 21, 2009 4:33 am 
Newbie

Joined: Mon Dec 21, 2009 4:23 am
Posts: 13
Hello

I m using Visual Studio 2005 and on calling

configuration.Configure();

I get the following Exception

NHibernate.MappingException: Could not compile the mapping document: nhibernate_test.User.hbm.xml ---> NHibernate.HibernateException: Could not instantiate dialect class NHibernate.Dialect.MsSql2005Dialect ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'NHibernate.NHibernateUtil' threw an exception. ---> System.TypeLoadException: Could not load type 'System.DateTimeOffset' from assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
at NHibernate.Type.DateTimeOffsetType.get_ReturnedClass()
at NHibernate.NHibernateUtil..cctor()
--- End of inner exception stack trace ---
at NHibernate.Dialect.Dialect..ctor()
at NHibernate.Dialect.MsSql2000Dialect..ctor()
at NHibernate.Dialect.MsSql2005Dialect..ctor()
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at NHibernate.Bytecode.ActivatorObjectsFactory.CreateInstance(Type type)
at NHibernate.Dialect.Dialect.InstantiateDialect(String dialectName)
--- End of inner exception stack trace ---
at NHibernate.Dialect.Dialect.InstantiateDialect(String dialectName)
at NHibernate.Dialect.Dialect.GetDialect(IDictionary`2 props)
at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)
--- End of inner exception stack trace ---
at NHibernate.Cfg.Configuration.LogAndThrow(Exception exception)
at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)
at NHibernate.Cfg.Configuration.ProcessMappingsQueue()
at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name)
at NHibernate.Cfg.Configuration.AddResource(String path, Assembly assembly)
at NHibernate.Cfg.Configuration.DoConfigure(IHibernateConfiguration hc)
at NHibernate.Cfg.Configuration.Configure(XmlReader textReader)
at NHibernate.Cfg.Configuration.Configure(String fileName, Boolean ignoreSessionFactoryConfig)
at NHibernate.Cfg.Configuration.Configure()
at nhibernate_test.Program.Main(String[] args) in C:\Documents and Settings\ed91246\Desktop\nhibernate_test\nhibernate_test\Program.cs:line 17

this is my hibernate.cfg.xml

<configuration>

<configSections>

<section name="hibernate-configuration"
type="NHibernate.Cfg.ConfigurationSectionHandler,NHibernate"/>
</configSections>

<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">

<session-factory>

<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="connection.connection_string">Data Source=abcd,2431;initial catalog=cpm;User Id=abc;Password=abc2008</property>

<mapping resource="nhibernate_test.User.hbm.xml" assembly="nhibernate_test" />

</session-factory>

</hibernate-configuration>

Thanks in Advance
Regards


Top
 Profile  
 
 Post subject: Re: MsSqlServer200xDialect Exception
PostPosted: Mon Dec 21, 2009 8:09 am 
Newbie

Joined: Mon Dec 21, 2009 8:06 am
Posts: 1
Dude, same problem here. I fixed it installing the last Service Pack of .NET Framework 2.0

http://www.microsoft.com/downloads/deta ... e506da9d0f

Good luck.


Top
 Profile  
 
 Post subject: Re: MsSqlServer200xDialect Exception
PostPosted: Mon Dec 21, 2009 8:48 am 
Newbie

Joined: Mon Dec 21, 2009 4:23 am
Posts: 13
OK
Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.