I'm trying to throw together a site pretty quickly, and so I enlisted the help of Twitter's Bootstrap project, which has been a lifesaver for a non-designer like me.
I'm now attempting to get the MiniProfiler up and running (it looks awesome!) but am having some trouble getting it to display and I hope someone can help me catch my (likely simple) mistake. This is the most basic of basic scenarios, and as far as I can tell I'm following the recommendations of the MiniProfiler site.
global.asax:
using MvcMiniProfiler;
...
protected void Application_BeginRequest()
{
//profile for every request while site is in dummy mode
MiniProfiler.Start();
}
protected void Application_EndRequest()
{
MiniProfiler.Stop();
}
The Controller I'm attempting to profile:
public ActionResult About()
{
var profiler = MiniProfiler.Current;
using (profiler.Step("Wassappp?"))
{
ViewBag.Title = "Heyyy there! Testing MiniProfiler.";
using (profiler.Step("Doing a pointless for loop!"))
{
int result;
for (int i = 0; i <= 10; i++)
{
result = i;
}
}
}
return View();
}
The relevant section of my _layout.cshtml page:
@using MvcMiniProfiler;
...
<head>
<meta charset="utf-8">
<title>@ViewBag.Title</title>
<meta name="description" content=""/>
<meta name="author" content=""/>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
<link href="http://twitter.github.com/bootstrap/1.3.0/bootstrap.min.css" rel="stylesheet">
<link href="@Url.Content("~/Content/site_bootstrap.css")" rel="stylesheet">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
@MvcMiniProfiler.MiniProfiler.RenderIncludes()
</head>
Any ideas? The site displays exactly fine, but without any sort of MiniProfiler action.
Thanks in advance for any help you can give!
I just downloaded the Twitter Bootstrap package I made http://nuget.org/List/Packages/MahApps.Twitter.Bootstrap and then the MiniProfiler.MVC package http://nuget.org/List/Packages/MiniProfiler.MVC3 and then made sure the RenderIncludes line was below the CSS definitions and it worked fine.
I'd try a shortcut and make sure you're using the MVC package of Miniprofiler.