我在 MVC 项目中调用的 App_Start() 方法中使用 miniprofiler
MiniProfilerEF6.Initialize()
我收到错误:
the Entity Framework was already using a DbConfiguration
instance before an attempt was made to add an 'Loaded' event handler.
'Loaded' event handlers can only be added as part of application start
up before the Entity Framework is used. See http://go.microsoft.com/fwlink/?LinkId=260883 for more information.
尝试在 Global.asax 的 application_start 函数中添加 MiniProfilerEF6.Initialize() 并确保这是那里的第一行。
protected void Application_Start()
{
StackExchange.Profiling.EntityFramework6.MiniProfilerEF6.Initialize();
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)