2008-10-06 4 views
4

윈도우 머신에 WinForm 앱을 빌드했고 앱이 작동 중임 ok. 내가 사용자 nhibernate 1.2.1 때 애플 리케이션도 리눅스 기계 모노를 사용하지만, 지금은 내가 nhibernate 2.0.1로 애플 리케이션을 업그레이 드했을 때 그것은 윈도우에서만 작동합니다. 내가 오류 얻을했습니다 : NHibernate.InvalidProxyTypeException을 : 다음과 같은 유형이 가 프록시로 사용되지 않을 수 있습니다 xxxx.Data.Dao.Credit : 방법 obj_address는 가 ...... 사람이 좀 도와 수있는 가상이어야한다 이 문제?모노로 Nhibernate 2.0.1

답변

0

나는 자 NHibernate를 사용하려고 시도하는 모노에도입니다. 대부분의 포럼은 문자열을 가상으로 설정하면 문제가 해결 될 것이라고 말하지만이 문제는 저에게 도움이되지 못합니다. 어떤 호기심 것은 내 오류가 거의 동일하다는 것이다 -

"주소"뭔가 다른 예약되어 있습니다 "방법 obj_address은

이 날 프록시를 생각하게 가상해야한다". 이 열의 이름을 변경해보십시오.

1

NHibernate 구성 프록시 검사기를 사용하거나 사용하지 않도록 설정할 수 있습니다. 그것은 모노와 함께 작동하지 않는 것 같습니다.

app/web.config nhibernate 섹션에 <property name="use_proxy_validator">false</property>을 추가하면됩니다. http://www.mail-archive.com/[email protected]/msg02109.html

을하거나 수정 :이 속성 세트와 config (설정) 예를 들어

여기를 참조

<?xml version="1.0"?> 
<configuration> 
    <configSections> 
    <section name="hibernate-configuration" 
      type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" /> 
    </configSections> 

    <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> 
    <session-factory> 
     <!-- 
     <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property> 
     <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property> 
     <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> 
     <property name="connection.connection_string">Data Source=YOUR_DB_SERVER;Database=Northwind;User ID=YOUR_USERNAME;Password=YOUR_PASSWORD;</property> 
     <property name="connection.isolation">ReadCommitted</property> 
     <property name="default_schema">Northwind.dbo</property> 
      --> 
     <!-- 
     <property name="dialect">NHibernate.Dialect.SQLiteDialect</property> 
     <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property> 
     <property name="connection.driver_class">NHibernate.Driver.SQLiteDriver</property> 
     <property name="connection.connection_string">Data Source=nhibernate.db;Version=3</property> 
     <property name="query.substitutions">true=1;false=0</property> 
      --> 
      <!-- mysql 
     <property name="dialect">NHibernate.Dialect.MySQLDialect</property> 
     <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property> 
     <property name="connection.driver_class">NHibernate.Driver.MySqlDataDriver</property> 
     <property name="connection.connection_string">Database=test</property> 
      --> 
      <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property> 
      <property name="connection.driver_class">NHibernate.Driver.NpgsqlDriver</property> 
      <property name="connection.connection_string">Server=localhost;database=test;User id=jrwren;password=yourpasswordhere.</property> 
      <property name="dialect">NHibernate.Dialect.PostgreSQLDialect</property> 
      <property name="use_proxy_validator">false</property> 
     <!-- HBM Mapping Files --> 
     <mapping assembly="Test.exe" /> 
    </session-factory> 
    </hibernate-configuration> 

</configuration>