從數據庫獲取提供程序信息時發生錯誤。這可能是由實體框架使用不正確的連接字符串造成的。檢查內部異常以獲取詳細信息,並確保連接字符串正確。提供程序未返回ProviderManifestToken字符串實體框架
內部異常:{"The provider did not return a ProviderManifestToken string."}
我搜索其他線程,因爲有許多類似的錯誤,但我似乎無法找到解決的辦法。
我正在使用VS2012專業版和SQL Server 2012.我能夠使用Windows身份驗證使用服務器資源管理器連接到服務器。我正在構建一個具有多層的webforms應用程序。其中之一包含我的實體框架層,其中包含我的上下文類。
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<connectionStrings>
<add name="MYSQLSERVER"
providerName="System.Data.SqlClient"
connectionString="Data Source=myComputer\MYSQLSERVER;Trusted_Connection=true"></add>
</connectionStrings>
</configuration>
這是我的實體框架類庫層中的app.config的樣子。
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
</configuration>
而且,我試圖改變在app.config defaultConnectionFactory類型
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
但它並沒有改變任何東西。
我不確定我做出的任何更改甚至是什麼讓我感到擔憂。當然,我可以在網上找到解決方案,並解決了我的問題,但我真的很想了解web.config以及這意味着什麼。除了找到解決這個問題的方法之外,誰能指出我正確的學習web.configs的方向?
感謝您的幫助。
是的,得到了這個,它顯然只是服務器名稱不正確。 –