this example을 기본 예제로 고려하십시오. 응용 프로그램을 만들었지 만 다음 응용 프로그램을 실행할 때 다음 오류가 발생합니다. 사용 가능한 NHibernate.ByteCode 제공 업체 중 하나와 세션 공장 구성 섹션의NHibernate를 사용하는 중 오류
The ProxyFactoryFactory was not configured.
초기화 'proxyfactory.factory_class'속성. 예 : NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu 예 : NHibernate.ByteCode.Castle.ProxyFactoryFactory, 다음 NHibernate.ByteCode.Castle
내가 사용하고있는 코드입니다.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NHibernate;
using NHibernate.Cfg;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Configuration cfg = new Configuration();
cfg.AddAssembly("NHibernate");
ISessionFactory factory = cfg.BuildSessionFactory(); //getting error at this line
ISession session = factory.OpenSession();
ITransaction transaction = session.BeginTransaction();
User newUser = new User();
newUser.Id = "joe_cool";
newUser.UserName = "Joseph Cool";
newUser.Password = "abc123";
newUser.EmailAddress = "[email protected]";
newUser.LastLogon = DateTime.Now;
// Tell NHibernate that this object should be saved
session.Save(newUser);
// commit all of the changes to the DB and close the ISession
transaction.Commit();
session.Close();
}
}
구성은 어떻게 생겼습니까? –
확인 내 설정은? XML 버전 = "1.0"인코딩 = "UTF-8" 처럼 보인다?> <구성> <섹션 이름 = "NHibernate에" 유형 = "System.Configuration.NameValueSectionHandler, 시스템, 버전 = 1.0.5000.0, 문화 = 중립, PublicKeyToken = b77a5c561934e089 " /> configSections> –