尝试在Windows窗体应用程序(.net 4.5 EF5)中使用WCF数据服务(.net 4 EF?)时出错

时间:2013-07-26 14:33:45

标签: winforms wcf entity-framework

不确定为什么它正在寻找实体框架,却无法找到它。完全消隐该怎么做。

Could not load file or assembly

在Windows窗体应用程序中,app.config具有此

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

我的web.config包含

<assemblies>
    <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>

Form1中:

  public Form1 (): base()
  {
  InitializeComponent();
  MAXFMWebEntities context = new MAXFMWebEntities();
  }

1 个答案:

答案 0 :(得分:0)

更新了app.config 在Could not load file or assembly Microsoft.Data.OData Version=5.2.0.0 error in Azure Cloud Worker Role using Table Storage

中建议
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="5.0.0.0" />
  </dependentAssembly>