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
这是我的问题:
我正在建立一个在线商店,我希望我的OnlineStoreDBContext继承IdentityDbContext
,这就是为什么我必须使用Microsoft.AspNet.Identity.EntityFramework库!但无论我从开始和删除整个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; }
}
答案 0 :(得分:1)
您是否尝试过解压缩解决方案中的packages文件夹?如果删除该目录并让nuget提取所有软件包的新版本,则可能会处理您所看到的任何奇怪行为。
答案 1 :(得分: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>
答案 2 :(得分:0)
以编辑模式打开project / solution
个文件,并查看Microsoft.AspNet.Identity.EntityFramework&#39;的位置。正在被引用。