locked
Could not load file or assembly… System.Data.Entity.dll RRS feed

  • Question

  • User-2081827145 posted

    Server Error in '/' Application.

    Could not load file or assembly 'file:///C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Data.Entity.dll' or one of its dependencies. The system cannot find the file specified.

    below my web.config file - what could be the problem?? If I am logged in and using the application everything works. If I leave the app and not use it for for than 15 or 20 mins next time I try to enter the I get the error above.

    I already tried cleaning the solution and adding again. Build completes successfuly every time but same error =/

    Thank you for any help in advanced

    <?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>
      <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=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
      </configSections>
      <connectionStrings>
        <!--<add name="***" connectionString="Data Source=winserver;Initial Catalog=***;USER ID=***; Password=***; MultipleActiveResultSets=true;" providerName="System.Data.SqlClient"/>-->
        <add name="***" connectionString="Data Source=plcentral.ca;Initial Catalog=***;Integrated Security=False; User ID=***;Password=*** providerName="System.Data.SqlClient"/>
        <!--<add name="***" connectionString="Data Source=(local);Initial Catalog=***;Integrated Security=True;" providerName="System.Data.SqlClient"/>-->
        <!--<add name="***" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|***.mdf;Integrated Security=True;User Instance=True"
    providerName="System.Data.SqlClient" />-->
        <!--<add name="***" connectionString="Data Source=***;Initial Catalog=***;Integrated Security=False; User ID=***;Password=***" providerName="System.Data.SqlClient" />-->
      </connectionStrings>
      <appSettings>
        <add key="webpages:Version" value="2.0.0.0"/>
        <add key="webpages:Enabled" value="false"/>
        <add key="PreserveLoginUrl" value="true"/>
        <add key="ClientValidationEnabled" value="true"/>
        <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
        <add key="GoogleAccount" value="email@email.com"/>
        <add key="GoogleAccountPwd" value="password"/>
        <!--<add key="GoogleAccount" value="email@email.com"/>
        <add key="GoogleAccountPwd" value="password"/>-->
      </appSettings>
      <system.web>
        <customErrors mode="Off"/>
        <globalization culture="en-US" uiCulture="en-US"/>
        <compilation targetFramework="4.0" >
          <assemblies>
            <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
          </assemblies>
        </compilation>
        <httpRuntime maxRequestLength="20000000"/>
        <authentication mode="Forms">
          <forms loginUrl="~/Account/Login" timeout="2880"/>
        </authentication>
        <pages>
          <namespaces>
            <add namespace="System.Web.Helpers"/>
            <add namespace="System.Web.Mvc"/>
            <add namespace="System.Web.Mvc.Ajax"/>
            <add namespace="System.Web.Mvc.Html"/>
            <add namespace="System.Web.Optimization"/>
            <add namespace="System.Web.Routing"/>
            <add namespace="System.Web.WebPages"/>
            <add namespace="MvcJqGrid"/>
          </namespaces>
        </pages>
      </system.web>
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules runAllManagedModulesForAllRequests="true"/>
        <handlers>
          <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"/>
          <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit"/>
          <remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
          <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0"/>
          <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0"/>
          <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
        </handlers>
      </system.webServer>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
            <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
            <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System" publicKeyToken="b77a5c561934e089" culture="neutral"/>
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Xml" publicKeyToken="b77a5c561934e089" culture="neutral"/>
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Data" publicKeyToken="b77a5c561934e089" culture="neutral"/>
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Transactions" publicKeyToken="b77a5c561934e089" culture="neutral"/>
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Core" publicKeyToken="b77a5c561934e089" culture="neutral"/>
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
      <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
      </entityFramework>
    </configuration>

    Friday, October 4, 2013 6:39 PM

All replies

  • User-1454326058 posted

    Hi GTITC,

    Thanks for your post!

    According to your description, we can find the path of System.Data.Entity.dll file is 'file:///C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Data.Entity.dll”

    I suggest that you can create a new folder in your project (e.g. packages) and copy the  System.Data.Entity.dll file into it, then remove the EntityFramework reference and add the new reference using that System.Data.Entity.dll file.

    If your project has been checked into the version control, please add and check in that folder (e.g. packages) into the server.

    If you still have the issue, please provide the detail information about EntityFramwork’s properties. (Right click the ENtityFramwork reference in the VS and select the properties)

    Thanks

    Best Regards

    Monday, October 7, 2013 1:36 AM
  • User-2081827145 posted

    new folder goes into the root of the project and what name?

    these are the properties of the entity framework:

    (Name): EntityFramework

    Aliases: global

    Copy Local: True

    Culture:

    Description: EntityFramework.dll

    Embeded Interlop Types: False

    File Type: Assembly

    Identity: EntityFramework

    Path: C:\User\Documents\Visual Studio 2010\Projects\ProjectFile\packages\EntityFramework.5.0.0\lib\net40\EntityFramework.dll

    Resolved: True

    Runtime Version: v4.0.30319

    Specific Version: False

    Strong Name: True

    Version: 4.4.0.0

    I just checked in my project folder and I dont have packages\EntityFramework.5.0.0\lib\net40\

    EntityFramework.dll is in C:\User\Documents\Visual Studio 2010\Projects\ProjectFile\bin

    Monday, October 7, 2013 3:01 AM
  • User-1454326058 posted

    Hi GTITC,

    GTITC

    new folder goes into the root of the project and what name?

    You can create a new folder by right click your project=>Add=>New folder, the name is what you want. (e.g. Ref, ABC...)

    Then copy the dll into that folder.

    At last remove the EntityFramwork reference in the vs and add the new EntityFramwork reference using that dll file and build your project.

    On the other hand, I suggest that you can place your project in another Directory like D:/

    Thanks

    Best Regards

    Monday, October 7, 2013 4:33 AM
  • User-2081827145 posted

    ok sorry I did check again, I did have the references folder in

    C:\Users\UserName\Documents\Visual Studio 2010\Projects\Project1\packages\EntityFramework.5.0.0\lib\net40

    I looked inside here and didnt see the System.entity.data.dll so I copied it but same problem. After about 20-30 mins I get the same error message. I opened the app locally and left it there for about 3 hours did not get an error at all just happening in the live server. 

    Wednesday, October 9, 2013 10:16 PM
  • User-1426144113 posted

    Hi,

    Could you share your project in the skydrive?

    http://windows.microsoft.com/en-us/skydrive/change-access-permissions-faq

    I want to know why the error is said could not load 'file:///C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Data.Entity.dll', based on your reply the dll path property is C:\User\Documents\Visual Studio 2010\Projects\ProjectFile\packages\EntityFramework.5.0.0\lib\net40\EntityFramework.dll, they are not the same.

    Thanks

    Thursday, October 10, 2013 9:20 PM