Getting Error in Miniprofiler in ASP.NET MVC application
NickName:imran Ask DateTime:2016-08-29T17:42:17

Getting Error in Miniprofiler in ASP.NET MVC application

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

Copyright Notice:Content Author:「imran」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/39203102/getting-error-in-miniprofiler-in-asp-net-mvc-application

More about “Getting Error in Miniprofiler in ASP.NET MVC application” related questions

Getting Error in Miniprofiler in ASP.NET MVC application

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. 'Loa...

Show Detail

MVC MiniProfiler with ASP.NET MVC 4

After adding MVC MiniProfiler to my ASP.NET MVC 4 project, it complains about requiring System.Web.Mvc 3.0.0.0. Is there any way to use MiniProfiler with ASP.NET MVC 4? The following assembly red...

Show Detail

MiniProfiler ASP.NET MVC5 not able to get results

I am trying to use MiniProfiler for the ASP.NET MVC application. I installed the following NuGet packages. I configured the MiniProfiler in both Global.ascx and Also the script in my _Layout. But I...

Show Detail

Does MiniProfiler work in ASP.NET MVC2?

Does The StackExchange MiniProfiler http://code.google.com/p/mvc-mini-profiler/ work in ASP.NET MVC2? If so, how? When adding MiniProfiler to the project, what is the MVC2 equivalent of: @

Show Detail

MiniProfiler not displaying

I am using MiniProfiler v3.2.0.157 and MiniProfiler.EF6 v3.0.11 with C# for an ASP.NET MVC 4 website. While I can get the profiler to show up on the majority of the pages on the site, it does not s...

Show Detail

Asp.net MVC MiniProfiler "Request is not available in this context"

I am trying to use MiniProfiler for my MVC application which is using Oracle DB. Here is my global.asax . protected void Application_Start() { AreaRegistration.RegisterAllAreas(); ...

Show Detail

Can I use MiniProfiler to instrument an ASP.NET MVC WebApi website?

The ASP.NET MVC website I'm working on has some (Controller-derived) "user" pages and some (ApiController-derived) "api" pages. The site uses MiniProfiler to instrument the "user" pages, and I rea...

Show Detail

How to get MVC4 Project with MiniProfiler to build in TFS 2010?

I have an ASP.NET MVC4 project which builds in TFS. Since adding the MiniProfiler to the project, the builds fail as follows: CA0001 : The following error was encountered while reading module '

Show Detail

Miniprofiler for ASP.NET web site

How can I use miniprofiler in asp.net web site(NOT FOR MVC)? There are many resources for MVC but I can not find anything for web site. Thanks to Alex. Now it works for asp.net web site. But I ca...

Show Detail

MiniProfiler Showing Asp.Net Mvc Slow Call Actions Occasionally

We have started using MiniProfiler and it is showing that sometimes, particularly when we hit F5 when running in Visual Studio that the first 3 - 5 calls to an action are very slow before any of ou...

Show Detail