Fluent NHibernate 튜토리얼 http://wiki.fluentnhibernate.org/Getting_started을 통해 작업 했으므로 프로젝트가 잘 컴파일됩니다.Fluent NHibernate 튜토리얼 예제 실행시 런타임 오류
그러나 런타임 오류가 발생하며이를 해결할 수 없습니다. 튜토리얼에서 볼 수있는 CreateSessionFactory 메소드에서 오류가 발생했습니다. 여기있다 :
private static ISessionFactory CreateSessionFactory()
{
return Fluently.Configure()
.Database
(
SQLiteConfiguration.Standard
.UsingFile(DbFile)
)
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<FluentNHibernateSample.Program>())
.ExposeConfiguration(BuildSchema)
.BuildSessionFactory();
}
내가 할 수있는 가장 helpfule 것은 당신에게 예외 체인을 제공하는 것입니다 생각입니다 (그 진짜 단어) 내부 대부분의 예외에 대한 가장 바깥 쪽 예외에서 :
An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
Could not compile the mapping document: (XmlDocument)
persistent class FluentNHibernateSample.Entities.Employee, FluentNHibernate, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null not found
Could not load file or assembly 'FluentNHibernate, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
튜토리얼은 레퍼런스를 셋업하는 방법에 대해 명확하지 않았기 때문에 적어도 http://fluentnhibernate.org/downloads/releases/fluentnhibernate-1.1.zip에서 컴파일 된 어셈블리를 가져 와서 libs 폴더에 복사했습니다. Googling 오류를 기반으로 FluentNHibernate, NHibernate 및 NHibernate.ByteCode.Castle 어셈블리에 대한 참조를 설정했습니다. 다운로드 페이지의 모든 dll을 bin 디렉토리에 복사했는데 모든 참조가 해결 될 것이라고 생각했습니다. (그것이 어떻게 작동하는지에 대한 나의 이해입니다.) 어쨌든 여기에 빈으로 복사 한 파일 목록이 있습니다.
Antlr3.Runtime.dll
FluentNHibernate.dll
FluentNHibernate.exe
FluentNHibernate.pdb
FluentNHibernate.vshost.exe
FluentNHibernate.vshost.exe.manifest
FluentNHibernate.xml
Iesi.Collections.dll
Iesi.Collections.xml
log4net.dll
log4net.xml
NHibernate.ByteCode.Castle.dll
NHibernate.dll
NHibernate.xml
또한 System.Data.Sqlite 어셈블리를 bin에 복사했습니다.
내 인생에서 나는 그 문제가 무엇인지 알 수 없다. 내가 생각할 수있는 여러 가지 오류 메시지를 봤지만 아무것도 나를 위해 일한 모든 시도했다.
도움말! 나는 이것에 시간을 낭비했다.
내가 http://dl.dropbox.com/u/8824836/FluentNHibernateExample.zip에서 프로젝트의 소스 파일을 넣어 가지고
편집 할 수 있습니다. 내 환경을 완전히 복제하려면 here의 모든 파일을 출력/bin 디렉토리에 저장해야합니다.
세스
제안 해 주셔서 감사합니다. 언급 한 바와 같이, 그 파일들은 유창한 nhibernate 다운로드 우편 번호에 있기 때문에 ... 그들은 이미 내 bin 폴더에 추가되었습니다. 그러나 귀하의 제안에 따라 프로젝트에 해당 파일에 대한 참조가 추가되었습니다. 그러나 나는 같은 결과를 얻고있다. Seth –