找不到实体框架提供程序

时间:2015-10-20 14:20:50

标签: c# wpf entity-framework xaml entity-framework-6

我有两个月前开始的项目!我正在使用[LASG]:https://layerguidance.codeplex.com/架构来解决我的问题! 我正在使用我的解决方案,因为我收到了“没有为ADO.net提供商找到的实体框架提供商,其名称为'System.SData.SqlClient'”

应用程序配置文件包含完整的提供程序块

这是我的app.config文件:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="mssqllocaldb" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
  <connectionStrings>
    <add name="MASTERGESTION" connectionString="Data Source=ZZZZ\ZZZZZ;Initial Catalog=XXXXXX;User ID=YY;Password=ZZZZZZ" providerName="System.Data.SqlClient" />
  </connectionStrings>
</configuration>

我在其他计算机上复制了项目,在构建解决方案后,它正常启动而没有提供程序错误

我多次重建解决方案,我手动重新添加引用而没有响应!

请帮忙吗?我无缘无故地放松了六个小时

2 个答案:

答案 0 :(得分:0)

defaultConnectionFactory不应该是:

System.Data.Entity.Infrastructure.LocalDbConnectionFactory 

取而代之的是:

System.Data.Entity.Infrastructure.SqlConnectionFactory

我认为它适用于第二台机器,因为它安装了LocalDb,而第一台机器没有安装。

答案 1 :(得分:0)

尝试代替

var marked_question = $('#at_questions_container').next('.marked').attr('id');
alert(marked_question);

使用

User ID=YY;Password=ZZZZZZ

还添加Integrate Security=True

<context>
相关问题