csainty / Glimpse.RavenDb

RavenDb Profiling plugin for Glimpse
http://csainty.github.com/Glimpse.RavenDb
MIT License
8 stars 9 forks source link

Null value exception when using latest RavenDb (unstable) package #3

Open saguiitay opened 11 years ago

saguiitay commented 11 years ago

I keep getting "Value cannot be null. Parameter name: httpContext" exceptions, with the following stack trace: at System.Web.HttpContextWrapper..ctor(HttpContext httpContext) at Glimpse.Core.Extensibility.GlimpseTimer.get_Context() at Glimpse.Core.Extensibility.GlimpseTimer.get_TimerMetadata() at Glimpse.Core.Extensibility.GlimpseTimer.Start(String message, String category, String description) at Glimpse.RavenDb.Profiler.BeginRequest(Object sender, WebRequestEventArgs e) in C:\Projects\Glimpse.RavenDb\Glimpse.RavenDb\Profiler.cs:line 206

csainty commented 11 years ago

Is updating RavenDB the only change?

First guess from that stack trace is that a request is being fired not in the context of a web request. At the office atm, but will take a look later.

saguiitay commented 11 years ago

I've actually done quite a few changes, but none that are related to RavenDB itself and/or Glimpse (not changes related to the creation of the IDocumentStore/Session, or the registration of Glimpse).This is happening in an MVC project, if it helps... Date: Thu, 22 Nov 2012 07:50:27 -0800 From: notifications@github.com To: Glimpse.RavenDb@noreply.github.com CC: saguiitay@hotmail.com Subject: Re: [Glimpse.RavenDb] Null value exception when using latest RavenDb (unstable) package (#3)

Is updating RavenDB the only change?

First guess from that stack trace is that a request is being fired not in the context of a web request.

At the office atm, but will take a look later.

          —

          Reply to this email directly or view it on GitHub.
csainty commented 11 years ago

Are you doing any RavenDB work on another thread? I can reproduce this by wrapping a call to raven in a ThreadPool.Queue....

HttpContext.Current is ThreadLocal

If you are not explicitly doing it, then perhaps RavenDb is somewhere inside the new versions.

coryt commented 11 years ago

I think this might be related, I am using the latest 2.5.2603 unstable nuget package.

I have the Glimpse Raven Profiler configured through the web.config and I get the following error:

System.IO.FileNotFoundException: Could not load file or assembly 'Raven.Client.Lightweight, Version=2.5.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593' or one of its dependencies. The system cannot find the file specified. File name: 'Raven.Client.Lightweight, Version=2.5.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593' ---> System.IO.FileNotFoundException: Could not load file or assembly 'Raven.Client.Lightweight, Version=2.0.3.0, Culture=neutral, PublicKeyToken=37f41c7f99471593' or one of its dependencies. The system cannot find the file specified. File name: 'Raven.Client.Lightweight, Version=2.0.3.0, Culture=neutral, PublicKeyToken=37f41c7f99471593' WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value HKLM\Software\Microsoft\Fusion!EnableLog to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. at Glimpse.RavenDb.RavenDbTab.GetStoreList() at Glimpse.RavenDb.RavenDbTab.GetData(ITabContext context) in c:\Projects\Glimpse.RavenDb\Glimpse.RavenDb\RavenDbTab.cs:line 26 at Glimpse.Core.Framework.GlimpseRuntime.ExecuteTabs(RuntimeEvent runtimeEvent)

coryt commented 11 years ago

Some further debugging, it appears to be an issue when referencing the .Net 4.5 version of Raven.Client.Lightweight. I changed the reference to .Net 4.0 and the plugin works fine.