Skip to main content

Posts

Showing posts from June, 2014

Miniprofiler and QUnit in ASP.MVC

Miniprofiler and QUnit are simple DLL, JS and CSS files that can be added to an ASP.MVC project to identify trouble spots in a project such as server side functions that run longer than anticipated or intermittent JS errors/warnings that show up in browsers' consoles. Miniprofiler - keeps track of the amount of time functions in an ASP.MVC source code take to execute and displays the results on a browser. I have found that functions that take longer to execute are good candidates for refactoring. To add Miniprofiler: Use Package Manager to add references to Miniprofiler in your project PM> Install-Package MiniProfiler Update Global.asax file as follows (this is for making the library available globally in your project) using StackExchange.Profiling; and protected void Application_BeginRequest() { if (Request.IsLocal) { MiniProfiler.Start(); } } protected void Application_EndRequest() { MiniProfiler.Stop(); } Add the following one li