MiniProfiler -- NullReferenceException?

67 views
Skip to first unread message

Sean Killeen

unread,
Apr 3, 2014, 11:45:32 AM4/3/14
to servic...@googlegroups.com
[Posted to StackOverflow as well so we can catalog if a definitive answer is found: http://stackoverflow.com/questions/22842414/servicestack-profiler-nullreferenceexception]

Hi all,

First of all, I love the toolset -- thank you for it. 
I'm having an issue with the ServiceStack profiler and I'm assuming it's me that's the problem but want to confirm. :)

I'm just trying to get the basics in place. We currently have ServiceStack installed but only use the OrmLite functionality (so if there's some other setup required, I may not have known to do it.)

What I've done so far
---
The only steps I've taken so far to install profiling -- In `Global.asax.cs`:

       private void Application_BeginRequest(object sender, EventArgs e)
        {
            if (Request.IsLocal)
            {
                Profiler.Start();
            }
        }

        private void Application_EndRequest(object sender, EventArgs e)
        {
            Profiler.Stop();
        }

In my _SiteLayout.cshtml page, before any other javascript files are rendered, I have this line: 

    @Html.Raw(HttpUtility.HtmlDecode(Profiler.RenderIncludes().ToString()))

The Error I receive:

[NullReferenceException: Object reference not set to an instance of an object.]
ServiceStack.MiniProfiler.UI.MiniProfilerHandler.RenderIncludes(Profiler profiler, Nullable`1 position, Nullable`1 showTrivial, Nullable`1 showTimeWithChildren, Nullable`1 maxTracesToShow, Boolean xhtml, Nullable`1 showControls, String path) +293
ServiceStack.MiniProfiler.Profiler.RenderIncludes(Nullable`1 position, Nullable`1 showTrivial, Nullable`1 showTimeWithChildren, Nullable`1 maxTracesToShow, Boolean xhtml, Nullable`1 showControls) +99
 ....

Given that I'm trying to accomplish the basics, I'm unsure what could be null at this point. Is some sort of additional setup required prior to starting the profiler? Could it be a routing issue?

Thanks for your help as I try to get this up and running.

Sean Killeen

unread,
Apr 3, 2014, 9:40:00 PM4/3/14
to servic...@googlegroups.com
Hi all,

A brief follow up: for now, I took the easy way out. Installed MiniProfiler's standalone version and modified the ORMLite connection factories to return ProfiledDbConnections. Appears to have worked like a charm first time out.

Question: what does the ServiceStack profiler get me that the standard MiniProfiler doesn't? With its ease of use and the nuget ecosystem these days, I'm curious why SS would include the library rather than building a package for MiniProfiler and making it a dependency. I'm sure there's a good reason and I'd be interested to learn it.

Thanks again for a great product suite.

Sean

E-"mauled" from my mobile device; please excuse typos and brevity.


--
You received this message because you are subscribed to a topic in the Google Groups "ServiceStack .NET Open Source REST Web Services Framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/servicestack/IjLK0C-BL3U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to servicestack...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages