Hello everybody
I'm sorry that i have to disturb you, but I have a freaking problem.
I've done the QuickStart Guide from here:
http://www.hibernate.org/362.html#A7
okay the hole Nhibernate looks very simple.
Now I want to start the hole thing:
Code:
Configuration cfg = new Configuration();
cfg.AddAssembly("QuickStart");
Now I have a problem at the second line:
Could not compile the mapping document: QuickStart.user.hbm.xml
hmmm bad...
My log File:Code:
NHibernate.MappingException was unhandled
Message="Could not compile the mapping document: QuickStart.user.hbm.xml"
Source="NHibernate"
StackTrace:
at NHibernate.Cfg.Configuration.LogAndThrow(Exception exception) in c:\DATA\Projects\nhibernate\2.0.x\copy1\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 262
at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc) in c:\DATA\Projects\nhibernate\2.0.x\copy1\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 436
at NHibernate.Cfg.Configuration.ProcessMappingsQueue() in c:\DATA\Projects\nhibernate\2.0.x\copy1\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1557
at NHibernate.Cfg.Configuration.AddDocumentThroughQueue(NamedXmlDocument document) in c:\DATA\Projects\nhibernate\2.0.x\copy1\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1548
at NHibernate.Cfg.Configuration.AddXmlReader(XmlReader hbmReader, String name) in c:\DATA\Projects\nhibernate\2.0.x\copy1\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1541
at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name) in c:\DATA\Projects\nhibernate\2.0.x\copy1\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 506
at NHibernate.Cfg.Configuration.AddResource(String path, Assembly assembly) in c:\DATA\Projects\nhibernate\2.0.x\copy1\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 544
at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly) in c:\DATA\Projects\nhibernate\2.0.x\copy1\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 615
at NHibernate.Cfg.Configuration.AddAssembly(String assemblyName) in c:\DATA\Projects\nhibernate\2.0.x\copy1\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 601
at QuickStart.Form1.button1_Click(Object sender, EventArgs e) in C:\data\pkoster\Projekte\Visual C#\IssueTracker\QuickStart\QuickStart\Form1.cs:line 29
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at QuickStart.Program.Main() in C:\data\pkoster\Projekte\Visual C#\IssueTracker\QuickStart\QuickStart\Program.cs:line 17
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()
InnerException: System.Collections.Generic.KeyNotFoundException
Message="The given key was not present in the dictionary."
Source="mscorlib"
StackTrace:
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at NHibernate.Dialect.Dialect.GetDialect(IDictionary`2 props) in c:\DATA\Projects\nhibernate\2.0.x\copy1\nhibernate\src\NHibernate\Dialect\Dialect.cs:line 173
at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc) in c:\DATA\Projects\nhibernate\2.0.x\copy1\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 428
InnerException:
Hibernate version: 2.0.0.Alpha1
App.confCode:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section
name="nhibernate"
type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
/>
</configSections>
<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;initial catalog=nhibernate;Integrated Security=SSPI"
/>
</nhibernate>
</configuration>
user.hbm.xml:Code:
user.hbm.xml
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="QuickStart.user, QuickStart" table="Device">
<id name="Id" column="LogonId" type="Int32" length="20" >
<generator class="assigned">
</generator>
</id>
<property name="UserName" column="Name" type="String" length="40"></property>
<property name="Password" type="String" length="20"></property>
<property name="EmailAddress" type="String" length="40"></property>
<property name="LastLogon" type="DateTime"></property>
</class>
</hibernate-mapping>
I use Visual Studio 2008 (But .NetFramework 2.0)
I googled very long, made many examples but no one works.
Can anybody help me? sorry for my bad english....
mfg - gartenschlauch[/code]