Click here to Skip to main content
15,879,096 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi ,

I am using custom providers to store information into my custom database,

Now the problem is when i try to log in through google, as i used external outh. when i click login .. i get following error:
Server Error in '/' Application.
Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.


Source Error:


Line 86:             // User has logged in with provider successfully
Line 87:             // Check if user is already registered locally
Line 88:             if (OpenAuth.Login(authResult.Provider, authResult.ProviderUserId, createPersistentCookie: false))
Line 89:             {
Line 90:                 RedirectToReturnUrl();


Source File: e:\E-books\Torakami Technologies\AutoProvidersSparepartsTrial\AutoSpareParts\AutoSpareParts\Account\RegisterExternalLogin.aspx.cs    Line: 88

Assembly Load Trace: The following information can be helpful to determine why the assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' could not be loaded.



=== Pre-bind state information ===
LOG: DisplayName = EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
 (Fully-specified)
LOG: Appbase = file:///E:/E-books/Torakami Technologies/AutoProvidersSparepartsTrial/AutoSpareParts/AutoSpareParts/
LOG: Initial PrivatePath = E:\E-books\Torakami Technologies\AutoProvidersSparepartsTrial\AutoSpareParts\AutoSpareParts\bin
Calling assembly : Microsoft.AspNet.Membership.OpenAuth, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: E:\E-books\Torakami Technologies\AutoProvidersSparepartsTrial\AutoSpareParts\AutoSpareParts\web.config
LOG: Using host configuration file: C:\Users\Nilesh\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
LOG: Attempting download of new URL file:///C:/Users/Nilesh/AppData/Local/Temp/Temporary ASP.NET Files/root/bdf53e2f/603a42fd/EntityFramework.DLL.
LOG: Attempting download of new URL file:///C:/Users/Nilesh/AppData/Local/Temp/Temporary ASP.NET Files/root/bdf53e2f/603a42fd/EntityFramework/EntityFramework.DLL.
LOG: Attempting download of new URL file:///E:/E-books/Torakami Technologies/AutoProvidersSparepartsTrial/AutoSpareParts/AutoSpareParts/bin/EntityFramework.DLL.
LOG: Attempting download of new URL file:///E:/E-books/Torakami Technologies/AutoProvidersSparepartsTrial/AutoSpareParts/AutoSpareParts/bin/EntityFramework/EntityFramework.DLL.
LOG: Attempting download of new URL file:///C:/Users/Nilesh/AppData/Local/Temp/Temporary ASP.NET Files/root/bdf53e2f/603a42fd/EntityFramework.EXE.
LOG: Attempting download of new URL file:///C:/Users/Nilesh/AppData/Local/Temp/Temporary ASP.NET Files/root/bdf53e2f/603a42fd/EntityFramework/EntityFramework.EXE.
LOG: Attempting download of new URL file:///E:/E-books/Torakami Technologies/AutoProvidersSparepartsTrial/AutoSpareParts/AutoSpareParts/bin/EntityFramework.EXE.
LOG: Attempting download of new URL file:///E:/E-books/Torakami Technologies/AutoProvidersSparepartsTrial/AutoSpareParts/AutoSpareParts/bin/EntityFramework/EntityFramework.EXE.



Stack Trace:


[FileNotFoundException: Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.]
   Microsoft.AspNet.Membership.OpenAuth.EFOpenAuthMembershipDatabase.GetMembershipUserName(String providerName, String providerUserId, Boolean updateLastUsed) +0
   Microsoft.AspNet.Membership.OpenAuth.OpenAuthManager.Login(HttpContextBase context, String providerName, String providerUserId, Boolean createPersistentCookie) +285
   Microsoft.AspNet.Membership.OpenAuth.OpenAuth.Login(String providerName, String providerUserId, Boolean createPersistentCookie) +109
   AutoSpareParts.Account.RegisterExternalLogin.ProcessProviderResult() in e:\E-books\Torakami Technologies\AutoProvidersSparepartsTrial\AutoSpareParts\AutoSpareParts\Account\RegisterExternalLogin.aspx.cs:88
   AutoSpareParts.Account.RegisterExternalLogin.Page_Load() in e:\E-books\Torakami Technologies\AutoProvidersSparepartsTrial\AutoSpareParts\AutoSpareParts\Account\RegisterExternalLogin.aspx.cs:39
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +9585477
   System.Web.UI.Control.OnLoad(EventArgs e) +92
   System.Web.UI.Control.LoadRecursive() +54
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.33440

Below is my web.config file ..

XML
<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
  </configSections>
  <connectionStrings>
    <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-AutoSpareParts-20141021232459;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-AutoSpareParts-20141021232459.mdf" />
    <add name="AutoSparePartsConnection" providerName="System.Data.SqlClient" connectionString="Data Source=TORAKAMI\TORAKAMI;Initial Catalog=AutoSpareParts;Integrated Security=True" />
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login" timeout="2880" defaultUrl="~/" />
    </authentication>
    <profile defaultProvider="DefaultProfileProvider">
      <providers>
        <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
      </providers>
    </profile>
    <machineKey validationKey="C50B3C89CB21F4F1422FF158A5B42D0E8DB8CB5CDA1742572A487D9401E3400267682B202B746511891C1BAF47F8D25C07F6C39A104696DB51F17C529AD3CABE" decryptionKey="8A9BE8FD67AF6979E7D20198CFEA50DD3D3799C77AF2B72F" validation="SHA1" />
    <membership defaultProvider="HDIMembershipProvider" userIsOnlineTimeWindow="15">
      <providers>
        <clear />
        <add name="HDIMembershipProvider" type="AutoSparePartsClassLibrary.CustomMembershipProvider, AutoSparePartsClassLibrary" connectionStringName="AutoSparePartsConnection" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false" writeExceptionsToEventLog="false" />
      </providers>
    </membership>
    <roleManager defaultProvider="DefaultRoleProvider">
      <providers>
        <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
      </providers>
    </roleManager>
    <!--
            If you are deploying to a cloud environment that has multiple web server instances,
            you should change session state mode from "InProc" to "Custom". In addition,
            change the connection string named "DefaultConnection" to connect to an instance
            of SQL Server (including SQL Azure and SQL  Compact) instead of to SQL Server Express.
      -->
    <sessionState mode="InProc" customProvider="DefaultSessionProvider">
      <providers>
        <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
      </providers>
    </sessionState>
  </system.web>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
        <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <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>
</configuration>
Posted
Updated 15-Mar-20 7:18am
v3

Hi,

First check which version EF you using. Check the your version.
If you want to upgrade your version you can manage EF upgrade from NuGet.

Go to your Project solution - > 'Manage NuGet packet for Solution', click 'Manage' on 'Entity Framework'.

Now, Check your app.config . Maybe here wrong version number. The name="entityFramework" should have the correct version number.

Regards,
Praneet
 
Share this answer
 
This can happen if your project name conflicts with a nuget package you referenced. I wasted about 3 hrs before I realized what is going on
 
Share this answer
 
Comments
Richard MacCutchan 15-Mar-20 13:36pm    
I suspect this issue was solved, or abandoned, long ago.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900