![](/img/trans.png)
[英]Could not create the driver from NHibernate.Driver.SQLite20Driver
[英]Could not create the driver from NHibernate.Driver.SQLServerDriver
我有以下 hibernate.cfg.xml 代碼
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.MsSqlAzure2008Dialect</property>
<property name="connection.driver_class">NHibernate.Driver.SQLServerDriver</property>
<property name="connection.connection_string">Server=tcp:usedctp000dbs01.database.windows.net,1433;Initial Catalog=usedctp000db01;Persist Security Info=False;User ID={user};Password={password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication="Active Directory Password";</property>
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>
當我運行 BuildSessionFactory 時,出現以下異常
NHibernate.HibernateException: '無法從 NHibernate.Driver.SQLServerDriver 創建驅動程序。'
我發現了類似的問題,但與 MySQL 相關,解決方案是添加 Mysql.Data.dll,您知道我是否應該為 Azure SQL Server 上傳類似的文件? 我在哪里可以找到它? 我嘗試添加 sqlsrv32.dll 但出現以下錯誤
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.