ASP.NET MVC MiniProfiler和6的EntityFramework初始化 [英] ASP.NET MVC MiniProfiler and EntityFramework 6 Initialization

查看:318
本文介绍了ASP.NET MVC MiniProfiler和6的EntityFramework初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有装载MiniProfiler和MiniProfiler.EnitiyFramework6我有这个问题后,在类似的问题。 MiniProfiler运行良好,但是当我添加到我的Applcation_Start在Global.asax中

I have a similar issue in that after loading MiniProfiler and MiniProfiler.EnitiyFramework6 I have this issue. MiniProfiler runs fine, but when I add to my Applcation_Start in Global.asax

MiniProfilerEF6.Initialize();

MiniProfilerEF6.Initialize();

我得到这样的:

型System.IO.FileLoadException的异常出现在MiniProfiler.EntityFramework6.dll但在用户code没有处理

An exception of type 'System.IO.FileLoadException' occurred in MiniProfiler.EntityFramework6.dll but was not handled in user code

其他信息:无法加载文件或程序集MiniProfiler,版本= 3.0.11.0,文化=中性公钥= b44f9351044011a3'或它的一个依赖。找到的程序集清单定义不匹配程序集引用。 (异常来自HRESULT:0x80131040)

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

推荐答案

原来,这可能与版本和IDS。
如果安装MiniProfiler.EntityFramework6无需安装其他包,会的NuGet处理依赖关系,但它在这里放错#分别在web.config(确保版本号是正确的):

Turns out that this may be related to versions and ids. If you install MiniProfiler.EntityFramework6 without installing the other packages, nuget will handle the dependencies, but it puts the wrong #s in the web.config here (make sure the version number is correct):

 <dependentAssembly>
    <assemblyIdentity name="MiniProfiler" publicKeyToken="b44f9351044011a3" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-3.2.0.157" newVersion="3.2.0.157" />
  </dependentAssembly>

如果您卸载所有MiniProfiler包,然后按以下顺序进行安装:

If you uninstall all the MiniProfiler packages and then install in this order:

MiniProfiler结果
MiniProfiler.MVC4结果
MiniProfiler.EF6

MiniProfiler
MiniProfiler.MVC4
MiniProfiler.EF6

这似乎工作正常。

这篇关于ASP.NET MVC MiniProfiler和6的EntityFramework初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆