0

Hi i have problem with following error in spring net

An exception of type 'System.Configuration.ConfigurationErrorsException' occurred in Spring.Core.dll but was not handled in user code

Additional information: Error creating context 'spring.root': Keyword not supported: 'port'.

I have configurtaion in xml for dataprovider ans session factory, where probably is problem but i cant find where. Because when i am remove port (Port=3306;) from datasource definition it work neither

Error An exception of type 'System.Configuration.ConfigurationErrorsException' occurred in Spring.Core.dll but was not handled in user code

Additional information: Error creating context 'spring.root': The system cannot find the file specified

<db:provider id="DbProvider"
  provider="System.Data.SqlClient"
  connectionString="Server=127.0.0.1;Port=3306;Database=dbschema;User ID=XXX; Password=XXXX"/>

<object id="NHibernateSessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate4">
<property name="DbProvider" ref="DbProvider"/>
<property name="MappingAssemblies">
  <list>
    <value>WarehouseTemplate</value>
  </list>
</property>
<property name="HibernateProperties">
  <dictionary>
    <entry key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
    <entry key="dialect" value="NHibernate.Dialect.MySQL5Dialect"/>
    <entry key="connection.driver_class" value="NHibernate.Driver.MySqlDataDriver"/>
    <entry key="use_proxy_validator" value="false" />
    <entry key="show_sql" value="true"/>
  </dictionary>
</property>
<property name="ExposeTransactionAwareSessionFactory" value="true" />

My DB is MySql 5.7. Db is running on local but i want configuratiin with ip because i am planning after test move db elsewhere.

kronas
  • 71
  • 2
  • 6
  • 1
    `provider="System.Data.SqlClient"` ... that is not the provider you want as that expect you have Microsoft SQL Sever. How about using `provider="MySql.Data.MySqlClient"` or whatever it needs to be for MySql: https://stackoverflow.com/a/19898907/578411 – rene Jan 06 '18 at 19:58
  • And of course you arte right, thnkas for help it work now – kronas Jan 09 '18 at 21:27

0 Answers0