MiniProfiler.Windows icon indicating copy to clipboard operation
MiniProfiler.Windows copied to clipboard

MissingMethodException at StopAndGetConsoleFriendlyOutputStringWithSqlTimings() method

Open msanaei opened this issue 10 years ago • 0 comments

I installed MiniProfiler.Windows 1.0.0 Nuget package in my EF 6.1 winform project (.NET 4) and used in following code:

 public class MiniProfilerQueryHandlerDecorator<TQuery, TResult> : IQueryHandler<TQuery,    TResult>
 where TQuery : IQueryParameter<TResult>
{
    private readonly IQueryHandler<TQuery, TResult> _decoratee;

    public MiniProfilerQueryHandlerDecorator(IQueryHandler<TQuery, TResult> decoratee)
    {
        _decoratee = decoratee;
    }

    public TResult Handle(TQuery request)
    {
        TResult result;
        using (StackExchange.Profiling.MiniProfiler.Current.Step("Call QueryHandler"))
        {
            result =_decoratee.Handle(request);
        }
        var friendlyString = ConsoleProfiling.StopAndGetConsoleFriendlyOutputStringWithSqlTimings();
        Console.WriteLine(friendlyString);
        Debug.WriteLine(friendlyString);
        return result;
    }
}

but in runtime I get following MissingMethodException:

{"Method not found: 'Boolean StackExchange.Profiling.MiniProfiler.get_HasSqlTimings()'."} at MiniProfiler.Windows.ConsoleProfiling.StopAndGetConsoleFriendlyOutputStringWithSqlTimings(Int32 includeSqlWithDurationMoreThanMilliseconds, Int32 takeTopNumberOfQueries) at IASCo.Application.Core.CQRS.Query.QueryHandlerDecorators.MiniProfilerQueryHandlerDecorator2.Handle(TQuery request) in e:\DevProjects\PPL\SRC\NewStructure\IASCo.Application.Core\CQRS\Query\QueryHandlerDecorators\MiniProfilerQueryHandlerDecorator.cs:line 27 at Level4UI.Lists.BaseListFormStructure4.LoadPageData(Expression1 predicate) in e:\DevProjects\PPL\SRC\Level4UI\Lists\BaseListFormStructure.cs:line 46 at Level4UI.Lists.NewListForm4..ctor(BaseListFormStructure`4 listFormStructure, String clickedMenu) in e:\DevProjects\PPL\SRC\Level4UI\Lists\NewListForm.cs:line 72 at Level4UI.MainForm.NavigationItemsClicked(Object sender, NavBarLinkEventArgs e) in e:\DevProjects\PPL\SRC\Level4UI\MainForm.cs:line 422 at DevExpress.XtraNavBar.NavBarItem.RaiseLinkEvent(Object linkEvent, NavBarItemLink link) at DevExpress.XtraNavBar.NavBarItem.RaiseLinkClicked(NavBarItemLink link) at DevExpress.XtraNavBar.NavBarItem.RaiseLinkClickedCore(NavBarItemLink link) at DevExpress.XtraNavBar.NavBarControl.RaiseLinkClicked(NavBarItemLink link) at DevExpress.XtraNavBar.ViewInfo.NavBarViewInfo.DoLinkClick(NavBarHitInfo hitInfo) at DevExpress.XtraNavBar.ViewInfo.NavBarViewInfo.DoClick(NavBarHitInfo hitInfo) at DevExpress.XtraNavBar.ViewInfo.NavBarViewInfo.OnMouseUp(MouseEventArgs e) at DevExpress.XtraNavBar.NavBarControl.OnMouseUp(MouseEventArgs ev) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at DevExpress.XtraNavBar.NavBarControl.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at Level4UI.Program.Main() in e:\DevProjects\PPL\SRC\Level4UI\Program.cs:line 77

at var friendlyString = ConsoleProfiling.StopAndGetConsoleFriendlyOutputStringWithSqlTimings(); line.

msanaei avatar Aug 05 '14 09:08 msanaei