Hey,
I have a problem in my Global.cs file
(its a file i have copied from a working example)
namespace Hibernate
{
public sealed class Global
{
private static Configuration nhConfig;
private static ISessionFactory nhFactory;
[STAThread]
static void Main()
{
nhConfig = new Configuration();
nhConfig.AddAssembly("Hibernate"); <---My exception is here
nhFactory = nhConfig.BuildSessionFactory();
}
public static ISession NHSession
{
get { return nhFactory.OpenSession(); }
}
private Global() { }
}
}
If you need some more info then let me know.
Im kind of new to .net and to NHibernate so im having some trouble to see through this exception.
Any help would be preciated :)
Hibernate version: 1.2.0.GA
My App.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
<section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<log4net>
<appender name="rollingFile" type="log4net.Appender.RollingFileAppender, log4net" >
<param name="File" value="log.txt" />
<param name="AppendToFile" value="true" />
<param name="RollingStyle" value="Date" />
<param name="DatePattern" value="yyyy.MM.dd" />
<param name="StaticLogFileName" value="true" />
<layout type="log4net.Layout.PatternLayout, log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] <%X{auth}> - %m%n" />
</layout>
</appender>
<root>
<priority value="DEBUG" />
<appender-ref ref="rollingFile" />
</root>
</log4net>
<nhibernate>
<add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
<add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect" />
<add key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver" />
<add key="hibernate.connection.connection_string" value="Server=localhost;Database=nhibernate;User=sa;Pwd=bp6703;" />
<add key="hibernate.show_sql" value="true" />
</nhibernate>
</configuration>
My Login.hbm.xml
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" assembly="Hibernate" namespace="Hibernate">
<class name="Login" table="login">
<id name="Recordid" column="recordid" type="Int64" unsaved-value="0">
<generator class="assigned"/>
</id>
<property column="user" type="String" name="User" length="0" />
<property column="password" type="String" name="Password" length="0" />
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:
System.IO.FileNotFoundException was unhandled
Message="Could not load file or assembly 'Iesi.Collections, Version=1.0.0.3, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. Den angivne fil blev ikke fundet."
Source="NHibernate"
FileName="Iesi.Collections, Version=1.0.0.3, Culture=neutral, PublicKeyToken=aa95f207798dfdb4"
FusionLog="=== Pre-bind state information ===\r\nLOG: User = MAXIMUSS_PC\\maximuss\r\nLOG: DisplayName = Iesi.Collections, Version=1.0.0.3, Culture=neutral, PublicKeyToken=aa95f207798dfdb4\n (Fully-specified)\r\nLOG: Appbase = file:///F:/Visual Studio 2005/Projects/NHibernate/Hibernate/bin/Debug/\r\nLOG: Initial PrivatePath = NULL\r\nCalling assembly : NHibernate, Version=1.2.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4.\r\n===\r\nLOG: This bind starts in default load context.\r\nLOG: Using application configuration file: F:\\Visual Studio 2005\\Projects\\NHibernate\\Hibernate\\bin\\Debug\\Hibernate.vshost.exe.config\r\nLOG: Using machine configuration file from C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\config\\machine.config.\r\nLOG: Post-policy reference: Iesi.Collections, Version=1.0.0.3, Culture=neutral, PublicKeyToken=aa95f207798dfdb4\r\nLOG: Attempting download of new URL file:///F:/Visual Studio 2005/Projects/NHibernate/Hibernate/bin/Debug/Iesi.Collections.DLL.\r\nLOG: Attempting download of new URL file:///F:/Visual Studio 2005/Projects/NHibernate/Hibernate/bin/Debug/Iesi.Collections/Iesi.Collections.DLL.\r\nLOG: Attempting download of new URL file:///F:/Visual Studio 2005/Projects/NHibernate/Hibernate/bin/Debug/Iesi.Collections.EXE.\r\nLOG: Attempting download of new URL file:///F:/Visual Studio 2005/Projects/NHibernate/Hibernate/bin/Debug/Iesi.Collections/Iesi.Collections.EXE.\r\n"
StackTrace:
at NHibernate.Cfg.AssemblyHbmOrderer.GetHbmFiles()
at NHibernate.Cfg.Configuration.AddResources(Assembly assembly, IList resources, Boolean skipOrdering)
at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly, Boolean skipOrdering)
at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly)
at NHibernate.Cfg.Configuration.AddAssembly(String assemblyName)
at Hibernate.Global.Main() in F:\Visual Studio 2005\Projects\NHibernate\Hibernate\Global.cs:line 18
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Name and version of the database/VS im using:
Visual Studio 2005 and MsSql 2005
|