2014-04-04 48 views
1
Error 2 Assembly 'Online_Store.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.AspNet.Identity.EntityFramework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'Microsoft.AspNet.Identity.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' c:\Users\postgres\Desktop\Online_Tan\Online_Store2013\Online_Store.Infrastructure\bin\Debug\Online_Store.Infrastructure.dll OnlineStore_Commercial 

这里是我的问题:程序集使用AspNetIdentity.EntityFramework 2.0版。 0具有更高版本比引用1.0.0版本

我在做一个在线商店,我想我的OnlineStoreDBContext继承IdentityDbContext,这就是为什么我必须使用微软AspNet.Identity.EntityFramework库!但无论我从beggining多少次启动和删除整个Online_Store.Infrastructure类库我得到同样的错误

public class OnlineStoreDBContext : IdentityDbContext<ApplicationUser> 

{ 
    public OnlineStoreDBContext() 
     : base("DefaultConnection") 
    { 
    } 

    public DbSet<Language> Languages { get; set; } 
    public DbSet<Category> Categories { get; set; } 
    public DbSet<CategoryLanguages> CategoryLanguages { get; set; } 
    public DbSet<Product> Product { get; set; } 
    public DbSet<ProductLanguages> ProductLanguages { get; set; } 
    public DbSet<ProductCategories> ProuctCategories { get; set; } 
    public DbSet<Order> Orders { get; set; } 
    public DbSet<OrderDetails> OrderDetails { get; set; } 
    public DbSet<Customer> Customers { get; set; } 







} 
+1

在您的项目参考中打开NuGet Manager并转到更新选项卡。应用任何可用的更新并查看错误是否消失。如果此项目在解决方案中引用其他项目,请确保它们是最新的。 –

+0

是的一切都好 - >没有更新! Itt让我疯狂 –

+0

不知何故,在你的二进制文件中,你有一个'Online_Store.Infrastructure'程序集引用了旧的Identity部件。您可以使用Fuslogvw.exe等工具检查程序集解析度:http://msdn.microsoft.com/en-us/library/vstudio/e74a18c4(v=vs.100).aspx –

回答

1

您是否尝试过在你的解决方案的摧毁包文件夹?如果您删除该目录并让nuget提供所有软件包的新版本,那么可能会考虑到您所看到的任何奇怪行为。

1

您可以添加绑定到老版本的请求重定向到新的一个这样的

<runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
      <assemblyIdentity name="Microsoft.AspNet.Identity.EntityFramework" publicKeyToken="31bf3856ad364e35" /> 
      <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" /> 
     </dependentAssembly> 
    </assemblyBinding> 
</runtime> 
0

打开project/solution文件在编辑模式下,并从其中“Microsoft.AspNet.Identity.EntityFramework”被称为检查从。

相关问题