none
EF 6 Provider Error RRS feed

  • Question

  • Hi,

    I have a web project and another project as my business logic layer (BLL). In the BLL I installed EF 6 using NuGet. And references the BLL assembly in the web project. Everything works perfect in the debugging mode.

    But in the production I get this following error.

    The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information

    Below is my setting in the app.config of the BLL project and in the web.config of the web project. They both are identical, but I still I get the above error.

    My production IIS version is 8.5

    <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
          <parameters>
            <parameter value="v11.0" />
          </parameters>
        </defaultConnectionFactory>
        <providers>
          <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
        </providers>
      </entityFramework>

    I wish to know what is the exact issue for this cause.

    Thanks in advance


    My blog : http://thuruinhttp.wordpress.com

    Saturday, August 2, 2014 7:37 PM

Answers

  • I found that when I do the publish from Visual Studio it doesn't publish the EntityFramework.SqlServer.dll 

    When I manually dropped the above assembly in the production folder everything works fine. 

    In my project setting the above assembly is marked as CopyToLocal = true. But no idea why the assembly isn't published.


    My blog : http://thuruinhttp.wordpress.com

    • Marked as answer by Thuru VMVP Sunday, August 3, 2014 5:07 PM
    Sunday, August 3, 2014 5:07 PM

All replies

  • I have a web project and another project as my business logic layer (BLL). In the BLL I installed EF 6 using NuGet. And references the BLL assembly in the web project. Everything works perfect in the debugging mode

    The DLL wanted in the link below in in your Bin folder most likely the Debug folder. And the DLL is nowhere to be find on the production machine for your application.

    http://msdn.microsoft.com/en-us/library/system.data.entity.sqlserver.sqlproviderservices(v=vs.113).aspx

    Sunday, August 3, 2014 6:00 AM
  • I found that when I do the publish from Visual Studio it doesn't publish the EntityFramework.SqlServer.dll 

    When I manually dropped the above assembly in the production folder everything works fine. 

    In my project setting the above assembly is marked as CopyToLocal = true. But no idea why the assembly isn't published.


    My blog : http://thuruinhttp.wordpress.com

    • Marked as answer by Thuru VMVP Sunday, August 3, 2014 5:07 PM
    Sunday, August 3, 2014 5:07 PM
  • I experienced the same thing today:

    In developer command prompt for visual studio 2013, With

    gacutil -l EntityFramework.SqlServer

    I can find that the assembly is in GAC.

    change the type in provider in web.config to strongname solve the issue:

    <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

    other issue, you can troubleshoot with fuslogvw



    • Edited by GuYuming Tuesday, November 17, 2015 10:01 AM
    Tuesday, November 17, 2015 3:39 AM