Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 333791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:59:39+00:00 2026-05-12T09:59:39+00:00

I feel so stupid for posting this but I can’t see what’s wrong here.

  • 0

I feel so stupid for posting this but I can’t see what’s wrong here. I wanted to see hot Nhibernate works, than I got in the site, downloaded it, and was following the quick start tutorial but doing some chances – I’m using MySql and it’s not a Product but a User in my project, but whatever…

When I run the test for schema generation I get an error, here is the error info:

TestCase 'Uniflu.Domain.Tests.GenerateSchema_Fixture.Can_generate_schema'  
failed: NHibernate.MappingException : Could not compile the mapping document:  
Uniflu.Domain.Mappings.Usuario.hbm.xml  
----> NHibernate.HibernateException : Could not instantiate dialect class     
NHibernate.Dialect.MySqlDialect  
----> System.TypeLoadException : Could not load type NHibernate.Dialect.MySqlDialect.
Possible cause: no assembly name specified.  
em NHibernate.Cfg.Configuration.LogAndThrow(Exception exception)  
em NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)  
em NHibernate.Cfg.Configuration.ProcessMappingsQueue()  
em NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name)  
em NHibernate.Cfg.Configuration.AddResource(String path, Assembly assembly)  
em NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly)  
E:\Projetos\Uniflu\Uniflu\Uniflu.Domain\Tests\GenerateSchema_Fixture.cs(17,0): em Uniflu.Domain.Tests.GenerateSchema_Fixture.Can_generate_schema()  
--HibernateException  
em NHibernate.Dialect.Dialect.InstantiateDialect(String dialectName)  
em NHibernate.Dialect.Dialect.GetDialect(IDictionary`2 props)  
em NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)  
--TypeLoadException  
em NHibernate.Util.ReflectHelper.TypeFromAssembly(AssemblyQualifiedTypeName name, Boolean throwOnError)  
em NHibernate.Util.ReflectHelper.ClassForName(String name)  
em NHibernate.Dialect.Dialect.InstantiateDialect(String dialectName)  

0 passed, 1 failed, 0 skipped, took 5,37 seconds (NUnit 2.5).  

My hibernate.cfg.xml:

<?xml version="1.0" encoding="utf-8" ?>  
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">  
<session-factory name="Test">  
<property name="connection.driver_class">NHibernate.Driver.MySqlDataDriver</property>  
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>  
<property name="dialect">NHibernate.Dialect.MySqlDialect</property>  
<property name="connection.connection_string">Server=Athenas;Database=uniflu;Uid=alaor;Pwd=test;</property>  
<property name="show_sql">true</property>  
</session-factory>  
</hibernate-configuration>  

My user class:

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  

namespace Uniflu.Domain  
{  
    public class Usuario  
    {  
        public virtual Guid Id { get; set; }  
        public virtual String Nome { get; set; }  
        public virtual String Email { get; set; }  
        public virtual String Senha { get; set; }  
        public virtual String Dica { get; set; }  
        public virtual DateTime DataCriado { get; set; }  
        public virtual DateTime UltimoAcesso { get; set; }  
        public virtual Boolean Ativo { get; set; }  
    }  
}  

My Usuario.hbm.xml:

<?xml version="1.0" encoding="utf-8" ?>  
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"  
               assembly="Uniflu.Domain"  
               namespace="Uniflu.Domain">  
<class name="Usuario">  
<id name="Id">  
<generator class="guid" />  
</id>  
<property name="Nome" />  
<property name="Email" />  
<property name="Senha" />  
<property name="Dica" />  
<property name="DataCriado" />  
<property name="UltimoAcesso" />  
<property name="Ativo" />  
</class>  
</hibernate-mapping>  

My solution name is Uniflu, my project is Uniflu.Domain, it’s a class library project, the directory structure is like this:

Uniflu
-> Uniflu.Domain
-> -> Properties
-> -> References
-> -> Mapping
-> -> -> Usuario.hbm.xml
-> -> Tests
-> -> -> GenerateSchema_Fixture
-> -> hibernate.hbm.xml
-> -> Usuario.cs

Guyz I can’t see what I’m doing wrong… I really need some light!! Please!!

Thankz in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:59:39+00:00Added an answer on May 12, 2026 at 9:59 am

    You misspelled MySQLDialect (note the case) in your hibernate.cfg.xml.

    Always pay attention to the exception message and stack trace.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, I feel totally stupid posting this. I am not sure if it is
I feel stupid asking this question, but I've been wrestling with it for hours
I feel stupid for not being able to find this, but where is the
I feel like this is a stupid question because it seems like common sense
I feel like a fool, but here goes: public interface IHasErrorController{ ErrorController ErrorController {
I feel like I should know this, but I haven't been able to figure
I feel like I'm re-inventing the wheel here, but I need to find a
Well! I feel really stupid for this question, and I wholly don't mind if
I feel stupid for asking, but there must be a one liner that does
I feel that it should be something very simple and obvious but just stuck

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.