Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'ServiceStack.MiniProfiler.IHtmlString' does not contain a definition for 'AsRaw'

I have installed servicestack MVC in a MVC4 app through nuget and trying to enable the mini profiler.

I have done as per the instructions the following in Global.asax:

protected void Application_BeginRequest(object src, EventArgs e)
    {
        if (Request.IsLocal)
            ServiceStack.MiniProfiler.Profiler.Start();
    }

protected void Application_EndRequest(object src, EventArgs e)
    {
        ServiceStack.MiniProfiler.Profiler.Stop();
    }      

And I placed the @ServiceStack.MiniProfiler.Profiler.RenderIncludes().AsRaw() in the layout page. However, this method does not exist in this reference. I can only see "ToHtmlString()" & "ToString()" in "@ServiceStack.MiniProfiler.Profiler.RenderIncludes()" which renders the html escaped. Has the "AsRaw()" method been removed in MVC4?

like image 330
Val Avatar asked Dec 06 '25 15:12

Val


1 Answers

T.AsRaw() is an extension method in ServiceStack.Html.HtmlExtensions.AsRaw so you basically need to include the ServiceStack.Html namespace.

like image 81
mythz Avatar answered Dec 08 '25 10:12

mythz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!