PDA

View Full Version : Logging for remote debugging purposes


dav
02-20-2007, 04:32 AM
I am having some interesting issues with my web service that only show up when Ihit it remotely. I doubt that I can remotely debug the web service (please correct me if I am wrong). I would like to add some basic logging to a text file so I can at least see what is going on over there. However, when trying to determine the assembly path in order to create my text file, a call such as Assembly.GetExecutingAssembly().Location is returning null. Does this make sense?

Any help would be appreciated.

dav
02-20-2007, 05:01 AM
I figured out that I can use the Server.MapPath to do the same thing.


One problem though, is that it seems like none of the Assembly reflection calls are working. They work fine when I test them on my dev box. Is there something that I am missing?

bruce
02-20-2007, 07:07 AM
error?


Bruce

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)

dav
02-20-2007, 07:28 AM
NullReferenceException during the call to Assembly.GetExecutingAssembly().Location. Could there be some rights thatthe account running my apppooldoesn't have on the server that is causing these calls to return null instead of a valid Assembly instance?


This one was failing too (same error - NullReferenceException)


writer.WriteLine("Version: " + Assembly.GetEntryAssembly().GetName().Version.ToSt ring());

vvsharma
02-20-2007, 08:20 AM
Why would you want to create the log at the assembly location?You should use Server.Mappath instead.Also I tried using and it Assembly.GetExecutingAssembly() works fine for me on DASP Servers.

Vikram

DiscountASP.NET
www.DiscountASP.NET (http://www.discountasp.net/)

dav
02-20-2007, 08:25 AM
The log was really just for debugging purposes and will be removed. This was a general logging class I use for WinForm apps too and just dumps the log file in the app directory, hence the GetEntryAssembly call. I used the Server.MapPath and it worked fine. I will have to dig in to see why the assembly stuff isn't working. Thanks for the reply.

joelnet
02-21-2007, 09:08 AM
wisemx said...



Joel Thoms said...
Try using this global error handler I created... http://joel.net/code/global_errors.aspx

It will email you full debug infoany time there is an error in your web application.


...That's pretty slick Bro, I'm gonna give it a try myself. http://community.discountasp.net/emoticons/wink.gifexcellent! Source is included, so if you have any additions to make, let me know :)


Joel Thoms
DiscountASP.NET
http://www.DiscountASP.NET

joelnet
02-21-2007, 12:10 PM
Try using this global error handler I created... http://joel.net/code/global_errors.aspx

It will email you full debug infoany time there is an error in your web application.


Joel Thoms
DiscountASP.NET
http://www.DiscountASP.NET

wisemx
02-21-2007, 12:52 PM
Joel Thoms said...
Try using this global error handler I created... http://joel.net/code/global_errors.aspx

It will email you full debug infoany time there is an error in your web application.


...That's pretty slick Bro, I'm gonna give it a try myself. http://community.discountasp.net/emoticons/wink.gif