1

I am getting following error during integration of miniprofiler

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 this for more information.

Below is code of Global.asax

protected void Application_Start()
    {
            StackExchange.Profiling.EntityFramework6.MiniProfilerEF6.Initialize();
             //MiniProfilerEF6.Initialize();
....
....
}

I am using

  • I am using ASP.NET MVC 4

  • EF 6 (Code first )

I searched this google but couldn't find any solution

imran
  • 11
  • 3
  • is this `StackExchange.Profiling.EntityFramework6.MiniProfilerEF6.Initialize()` the first line on the `Application_Start()` method ? – Sampath Aug 29 '16 at 09:52
  • @Sampath - Yes this is first line – imran Aug 29 '16 at 09:58
  • This is a duplicate question please see the answer error on http://stackoverflow.com/questions/27776510/error-on-miniprofileref6-initialize-c/42098605#42098605 – pjobs Feb 08 '17 at 18:45

0 Answers0