當前,我將數據庫名稱傳遞給構造函數DbContext
。在我App.Config
文件的connectionStrings
部分,我添加了一個連接字符串和指定的供應商名稱:如何在連接字符串中爲EF CodeFirst配置ProviderManifestToken
<connectionStrings>
<add name="myConnectionString" connectionString="[..]" providerName="System.Data.SqlClient"/>
</connectionStrings>
現在,我想從其他類型的配置源的連接字符串,但ProviderIncompatibleException
是拋出。異常包含以下消息:
"The provider did not return a providermanifesttoken string".
所以,我怎麼可以指定一個連接字符串中提供程序的名稱?目前我的字符串包含data source
,database
和一些其他配置設置。
可能重複[如何爲EF代碼優先配置ProviderManifestToken](http://stackoverflow.com/questions/4741499/how-to-configure-providermanifesttoken-for-ef-code-first) –