EmguCV 的例子程序,有一个异常:Could not compile the mapping document: ImageDatabase.PersistentImage.hbm.xml
我把完整的解决方案放到了网上,谁帮我看一下:
http://download.csdn.net/source/3118263
谢谢了哦!、、、、、、、、、、、、、、、、、、、、、、、、、using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
using Emgu.CV;
using Emgu.CV.Structure;namespace ImageDatabase
{
public sealed class ImageDatabase
{
//private const string CurrentSessionKey = "nhibernate.current_session";
private static readonly ISessionFactory sessionFactory;
private static ISession _currentSession; static ImageDatabase()
{
Configuration cfg = new Configuration().Configure("SqliteDB.XML"); String dbFileName = "f:/test.db";
cfg.Properties["connection.connection_string"] = String.Format("Data Source={0};Version=3", dbFileName);
try
{
cfg.AddAssembly(typeof(ImageDatabase).Assembly);//在这里出错Could not compile the mapping
} //document: ImageDatabase.PersistentImage.hbm.xml
catch (Exception err)
{
throw err;
}
//Create the table if this is a new database
if (!System.IO.File.Exists(dbFileName))
new SchemaExport(cfg).Execute(false, true, false); sessionFactory = cfg.BuildSessionFactory(); } public static ISession GetCurrentSession()
{
if (_currentSession == null || !_currentSession.IsOpen )
_currentSession = sessionFactory.OpenSession();
return _currentSession;
} public static void CloseSession()
{
if (_currentSession == null)
{
// No current session
return;
} _currentSession.Close();
_currentSession = null;
} public static void CloseSessionFactory()
{
if (sessionFactory != null)
{
sessionFactory.Close();
}
}
}
}
我把完整的解决方案放到了网上,谁帮我看一下:
http://download.csdn.net/source/3118263
谢谢了哦!、、、、、、、、、、、、、、、、、、、、、、、、、using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
using Emgu.CV;
using Emgu.CV.Structure;namespace ImageDatabase
{
public sealed class ImageDatabase
{
//private const string CurrentSessionKey = "nhibernate.current_session";
private static readonly ISessionFactory sessionFactory;
private static ISession _currentSession; static ImageDatabase()
{
Configuration cfg = new Configuration().Configure("SqliteDB.XML"); String dbFileName = "f:/test.db";
cfg.Properties["connection.connection_string"] = String.Format("Data Source={0};Version=3", dbFileName);
try
{
cfg.AddAssembly(typeof(ImageDatabase).Assembly);//在这里出错Could not compile the mapping
} //document: ImageDatabase.PersistentImage.hbm.xml
catch (Exception err)
{
throw err;
}
//Create the table if this is a new database
if (!System.IO.File.Exists(dbFileName))
new SchemaExport(cfg).Execute(false, true, false); sessionFactory = cfg.BuildSessionFactory(); } public static ISession GetCurrentSession()
{
if (_currentSession == null || !_currentSession.IsOpen )
_currentSession = sessionFactory.OpenSession();
return _currentSession;
} public static void CloseSession()
{
if (_currentSession == null)
{
// No current session
return;
} _currentSession.Close();
_currentSession = null;
} public static void CloseSessionFactory()
{
if (sessionFactory != null)
{
sessionFactory.Close();
}
}
}
}
有没有高手接一下!