473,289 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

Error on old code converted to VS 2005

I had some old code set to throw an email to me when a user hit an
exception.

VS 2003 worked fine with the code, VS 2005 when I run it in debug mode
pauses over the code each time, and gives me the message:

"HTTPException was unhandled by user code. Request Not Available in
this context."

This is the code that it says it doesn't like:

log2.WriteEntry("Remlink" & _
"MESSAGE: " & ex.Message.ToString & _
"\nURL: " & Request.Path & _
"\nSOURCE: " & ex.Source.ToString & _
"\nFORM: " & Request.Form.ToString() & _
"\nQUERYSTRING: " & Request.QueryString.ToString() & _
"\nTARGETSITE: " & ex.TargetSite.ToString & _
"\nSTACKTRACE: " & ex.StackTrace.ToString & _
EventLogEntryType.Error)

Basically, all I am doing is determining which log to write the event to
above, and then the code for the mail follows this code here.

Why is this thing now barfing on that particular line of code? Anything
I've found referencing the specific message has not been of any help.
Any ideas?
May 15 '06 #1
1 1023
Your long concatentated string refers to the Request object twice:
"\nFORM: " & Request.Form.ToString() & _
"\nQUERYSTRING: " & Request.QueryString.ToString() & _
The change that you made appears to be more than just a recompile. This
code is part of a routine that you are now calling from a service or some
other code that is not running in ASP.Net context. Therefore, the Request
object is not available. If you are not in ASP.Net, then there is no form
or querystring, so these values are not valuable anyway. You may want to
refactor your routine to pass in the parameters you want, and then have the
calling code pass in either the asp.net bits when calling from a web page,
or pass in empty strings when calling from a non-asp.net context.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Blasting Cap" <go****@christian.net> wrote in message
news:up**************@TK2MSFTNGP03.phx.gbl...I had some old code set to throw an email to me when a user hit an
exception.

VS 2003 worked fine with the code, VS 2005 when I run it in debug mode
pauses over the code each time, and gives me the message:

"HTTPException was unhandled by user code. Request Not Available in this
context."

This is the code that it says it doesn't like:

log2.WriteEntry("Remlink" & _
"MESSAGE: " & ex.Message.ToString & _
"\nURL: " & Request.Path & _
"\nSOURCE: " & ex.Source.ToString & _
"\nFORM: " & Request.Form.ToString() & _
"\nQUERYSTRING: " & Request.QueryString.ToString() & _
"\nTARGETSITE: " & ex.TargetSite.ToString & _
"\nSTACKTRACE: " & ex.StackTrace.ToString & _
EventLogEntryType.Error)

Basically, all I am doing is determining which log to write the event to
above, and then the code for the mail follows this code here.

Why is this thing now barfing on that particular line of code? Anything
I've found referencing the specific message has not been of any help.
Any ideas?

May 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Gary Hughes | last post by:
I'm getting the following error when attempting to link a managed C++ dll. I can't find any reference to these errors with google. Can anyone help? I've included the class definition causing the...
15
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
0
by: Joshua V. | last post by:
We are trying to implement Windows Error Reporting from within our VB.Net application. Basically we want to replace the standard unhandled exception message we use with the Windows Error Reporting...
2
by: DCC700 | last post by:
VS 2005 Converted Header causing error when publishing After converting from Visual Studio 2003 to 2005, I have had several issues with a header that is used throughout the project. The...
13
by: AAaron123 | last post by:
I downloaded the personal website starter kit and when I run it I get the error shown below. I found a way of using Launch Surface Area Configuration that is supposed to fix the remote setting...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.