Stratego
-
3/19/2011 6:01:05 PM
RE:Error on Firefox only that seems to be related to Analytics Browser Tracking
This error has reappeared two days later with absolutely nothing being changed in the web site or the server.
It is probably an environment issue because it only occurs on the host Windows Server 2008 R2 (which happens to be running in a Virtuozzo container) and is not constantly a problem.
It has never happened on my Vista dev machine.
So that it fails more elegantly, I have put a try/catch around the line in App_Code\Global.asax.cs but would appreciate a more robust solution as this comes and goes and some day my client may want to switch web analytics on.
I removed the try/catch and got the error again, then put it back and it fixed it a second time.
if (AnalyticsHelper.TrackBrowserTypesEnabled(siteName.Value)) try { string browser = HttpContext.Current.Request.Browser.Browser + HttpContext.Current.Request.Browser.MajorVersion.ToString() + "." + (HttpContext.Current.Request.Browser.MinorVersion > 0 ? HttpContext.Current.Request.Browser.MinorVersion.ToString().Remove(0, 2) : "0"); HitLogProvider.LogHit(HitLogProvider.BROWSER_TYPE, siteName.Value, null, browser, 0); } catch { }
|