none
entity framework RRS feed

  • Question

  • hi,

    i am getting this exception when i am trying to execute the app.

    Could not load file or assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    I am using vs2012 and window 8.

    Friday, August 2, 2013 8:45 PM

Answers

  • Hi chromeFor,

    Please check the entity framwork5.0 has already in your project.

    If so, please do as follows:

    1. Remove the Entity framwork5.0 from Reference in VS

    2. Clean you project

    3. Add Entity framwork5.0

    4. Build your project.

    Thanks

    Best Regards


    Starain Chen
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by chromeFor Tuesday, August 20, 2013 5:16 PM
    Monday, August 12, 2013 3:13 AM
    Moderator
  • Hi chromeFor,

    Based on your app.config file, please look at the section below:

    “<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />”

    Perhaps you did something mistake to check the EntityFramework reference, the version of EntityFramework is 4.4.0.0 instead of 5.0.0.0. Please check again the version of EntityFramwork, and provide the snapshot for the properties of EntityFramewok.

    If the version is 5.0.0.0, maybe there is an error in Visual Studio. Please try to create a new project and add the EntityFramework reference. Then check App.config file. If it still has a problem, please try to repair your VS and try again.

    Thanks

    Best Regards


    Starain Chen
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by chromeFor Tuesday, August 20, 2013 5:15 PM
    Friday, August 16, 2013 3:04 AM
    Moderator

All replies

  • Hi,chromeFor.

    in VS2012:

    1. Open Package Manager Console (Tools-> Library Package Manager –> Package Manager Console)

    2. In the tool window make sure your project is selected in the Default Project

    3. input command: Uninstall-Package EntityFramework -Force

    4.  input command: Install-Package EntityFramework




    Best Regards,
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Monday, August 5, 2013 1:29 AM
  • Hi chromeFor,

    Thanks for your post!

    According to your description, base on the error message, we can know that entityframwork5.0 is dependent of your app, so you should add the entityframwork5.0, we can add entityframwork5 follow this steps:

    1. Install NuGet Pagkage, please refer to: http://docs.nuget.org/docs/start-here/installing-nuget
    2. Install entityframwork, right-clicking on the References folder of your project and selecting Manage NuGet Packages…

      3.  Look for entityframwork and click install

    On the other hand, you can get entityframwork from:

    http://www.nuget.org/packages/entityframework/

    Thanks

    Best Regards


    Starain Chen
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, August 5, 2013 6:35 AM
    Moderator
  • Hi chromeFor,

    Please remember to mark the replies as answers if they help. If you have any questions, please let us know.

    Thanks

    Best Regards


    Starain Chen
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, August 7, 2013 1:46 AM
    Moderator
  • Hi, My problem is not solved dear friends.

    I have already tried these steps.

    Get the OpenPos from CodePlex please and guide me.


    When i try to debug the code then i see this exception.

    Thanks.

    Friday, August 9, 2013 9:24 PM
  • Hi chromeFor,

    Please check the entity framwork5.0 has already in your project.

    If so, please do as follows:

    1. Remove the Entity framwork5.0 from Reference in VS

    2. Clean you project

    3. Add Entity framwork5.0

    4. Build your project.

    Thanks

    Best Regards


    Starain Chen
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by chromeFor Tuesday, August 20, 2013 5:16 PM
    Monday, August 12, 2013 3:13 AM
    Moderator
  • I did the steps as you mentioned above but didn't worked.

    Same problem faced again at run time when i debug it (not at compile time).

    See below

    Could not load file or assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    see in snapshot.

    • Edited by chromeFor Wednesday, August 14, 2013 9:00 PM
    Wednesday, August 14, 2013 8:56 PM
  • Hi chromeFor,

    There are to solutions as follows:

    A. Right click the EntityFramwork select property, change the value of Specific Version to false. Run or Debug

    B. Open the web.config or app.config file, check the value of PublicKeyToken, it's should be b77a5c561934e089.

        If not, please modify the value. Run or Debug

    Thanks

    Best Regards


    Starain Chen
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, August 15, 2013 1:52 PM
    Moderator
  • Have you checked the project source located at here?

    please see that.

    already set false and i couldn't find web.config.

    instead app.config and in it, there are many public tokens.

    which one need to be modified?

    see the whole file please.

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <configSections>
        <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
          <section name="OpenPOS.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
        </sectionGroup>
        
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
      <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
      <loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="General" logWarningsWhenNoCategoriesMatch="true">
        <listeners>
          <add fileName="trace.log" header="----------------------------------------" footer="----------------------------------------" formatter="Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="FlatFile TraceListener" />
        </listeners>
        <formatters>
          <add template="Timestamp: {timestamp}&#xD;&#xA;Message: {message}&#xD;&#xA;Category: {category}&#xD;&#xA;Priority: {priority}&#xD;&#xA;EventId: {eventid}&#xD;&#xA;Severity: {severity}&#xD;&#xA;Title:{title}&#xD;&#xA;Machine: {machine}&#xD;&#xA;Application Domain: {appDomain}&#xD;&#xA;Process Id: {processId}&#xD;&#xA;Process Name: {processName}&#xD;&#xA;Win32 Thread Id: {win32ThreadId}&#xD;&#xA;Thread Name: {threadName}&#xD;&#xA;Extended Properties: {dictionary({key} - {value}&#xD;&#xA;)}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Text Formatter" />
        </formatters>
        <categorySources>
          <add switchValue="All" name="Debug">
            <listeners>
              <add name="FlatFile TraceListener" />
            </listeners>
          </add>
          <add switchValue="All" name="General">
            <listeners>
              <add name="FlatFile TraceListener" />
            </listeners>
          </add>
        </categorySources>
        <specialSources>
          <allEvents switchValue="All" name="All Events" />
          <notProcessed switchValue="All" name="Unprocessed Category" />
          <errors switchValue="All" name="Logging Errors &amp; Warnings">
            <listeners>
              <add name="FlatFile TraceListener" />
            </listeners>
          </errors>
        </specialSources>
      </loggingConfiguration>
      <exceptionHandling>
        <exceptionPolicies>
          <add name="Default Policy">
            <exceptionTypes>
              <add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="NotifyRethrow" name="Exception">
                <exceptionHandlers>
                  <add logCategory="General" eventId="100" severity="Error" title="Enterprise Library Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" priority="0" useDefaultLogger="true" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Logging Handler" />
                </exceptionHandlers>
              </add>
            </exceptionTypes>
          </add>
        </exceptionPolicies>
      </exceptionHandling>
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" />
      </startup>
      <userSettings>
        <OpenPOS.Properties.Settings>
          <setting name="Left" serializeAs="String">
            <value>100</value>
          </setting>
          <setting name="Top" serializeAs="String">
            <value>100</value>
          </setting>
          <setting name="Width" serializeAs="String">
            <value>1024</value>
          </setting>
          <setting name="Height" serializeAs="String">
            <value>768</value>
          </setting>
          <setting name="Title" serializeAs="String">
            <value>OpenPOS is a Open Source Point of Sale system</value>
          </setting>
          <setting name="WindowState" serializeAs="String">
            <value>Normal</value>
          </setting>
          <setting name="WindowStyle" serializeAs="String">
            <value>SingleBorderWindow</value>
          </setting>
        </OpenPOS.Properties.Settings>
      </userSettings>
      <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
          <parameters>
            <parameter value="v11.0" />
          </parameters>
        </defaultConnectionFactory>
      </entityFramework>
    </configuration>

    Thursday, August 15, 2013 7:19 PM
  • Hi chromeFor,

    Based on your app.config file, please look at the section below:

    “<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />”

    Perhaps you did something mistake to check the EntityFramework reference, the version of EntityFramework is 4.4.0.0 instead of 5.0.0.0. Please check again the version of EntityFramwork, and provide the snapshot for the properties of EntityFramewok.

    If the version is 5.0.0.0, maybe there is an error in Visual Studio. Please try to create a new project and add the EntityFramework reference. Then check App.config file. If it still has a problem, please try to repair your VS and try again.

    Thanks

    Best Regards


    Starain Chen
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by chromeFor Tuesday, August 20, 2013 5:15 PM
    Friday, August 16, 2013 3:04 AM
    Moderator
  • thanks .it is working a bit now.
    Tuesday, August 20, 2013 5:15 PM