I just created a new MVC 4 Basic project and added the package to the project and the needed code to the layout but nothing happened after first run.
This is the Layout:
@using StackExchange.Profiling;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
@MiniProfiler.RenderIncludes()
@RenderBody()
@Scripts.Render("~/bundles/jquery")
@RenderSection("scripts", required: false)
</body>
</html>
Update
I've added this code to the global.asax.cs
protected void Application_BeginRequest()
{
MiniProfiler.Start();
}
now this code appears in the HTML code:
<script async type="text/javascript" id="mini-profiler" src="/mini-profiler-resources/includes.js?v=xwYPDDH1blvqmxgsBweNC++H7CFU3KGQ+zFcVlJPsXw=" data-version="xwYPDDH1blvqmxgsBweNC++H7CFU3KGQ+zFcVlJPsXw=" data-path="/mini-profiler-resources/" data-current-id="6da0f73c-fa89-447b-92b1-56dc532947f4" data-ids="6da0f73c-fa89-447b-92b1-56dc532947f4" data-position="left" data-trivial="false" data-children="false" data-max-traces="15" data-controls="false" data-authorized="true" data-toggle-shortcut="Alt+P" data-start-hidden="false"></script>
but the /mini-profiler-resources/includes.js?v=xwYPDDH1blvqmxgsBweNC++H7CFU3KGQ+zFcVlJPsXw=
url returns a 404 error.
Thanks to spaceman the problem solved!
the problem was from the 404 error solved by adding this code to web.config
<system.webServer>
<handlers>
<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
have you added the initialise code to the global.asax file?
you need to hook into the application_beginrequest and application_endrequest methods also.
http://www.codeproject.com/Articles/516627/MiniProfilerplus-plusInstallationplusandplusSetup
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With