gpt4 book ai didi

c# - MiniProfilerEF6.Initialize() c# 出错?

转载 作者:太空狗 更新时间:2023-10-29 23:38:29 24 4
gpt4 key购买 nike

我在我调用的 App_Start() 方法上的 MVC 项目中使用 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();

}

关于c# - MiniProfilerEF6.Initialize() c# 出错?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27776510/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com