Hi wolli,
with the above commented Tutorial I wanted to start NHibernate without a config-file.
I tried a second test-solution without any config and it worked fine.
I located the exception in the Configuration.cs of NHibernate.
The Exception in German is:
Der Typeninitialisierer für NHibernate.Cfg.Environment hat eine Ausnahme verursacht
System.TypeInitializationException
This is the Codesnippet, where the fault is thrown:
Code:
/// <summary>
/// Clear the internal state of the <see cref="Configuration"/> object.
/// </summary>
protected void Reset()
{
classes = new Dictionary<string, PersistentClass>(); //new SequencedHashMap(); - to make NH-369 bug deterministic
imports = new Dictionary<string, string>();
collections = new Dictionary<string, NHibernate.Mapping.Collection>();
tables = new Dictionary<string, Table>();
namedQueries = new Dictionary<string, NamedQueryDefinition>();
namedSqlQueries = new Dictionary<string, NamedSQLQueryDefinition>();
sqlResultSetMappings = new Dictionary<string, ResultSetMappingDefinition>();
secondPasses = new List<SecondPassCommand>();
propertyReferences = new List<Mappings.PropertyReference>();
filterDefinitions = new Dictionary<string, FilterDefinition>();
interceptor = emptyInterceptor;
//In the next Line the Exception occurs
properties = Environment.Properties;
auxiliaryDatabaseObjects = new List<IAuxiliaryDatabaseObject>();
sqlFunctions = new Dictionary<string, ISQLFunction>();
mappingsQueue = new MappingsQueue();
eventListeners = new EventListeners();
typeDefs = new Dictionary<string, TypeDef>();
extendsQueue = new HashedSet<ExtendsQueueEntry>();
tableNameBinding = new Dictionary<string, Mappings.TableDescription>();
columnNameBindingPerTable = new Dictionary<Table, Mappings.ColumnNames>();
}
I've located the error but I dont know, where the Environment-variables are set...