Logging for remote debugging purposes

Discussion in 'ASP.NET WebServices' started by dav, Feb 20, 2007.

  1. dav

    dav

    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.
     
  2. dav

    dav

    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?
     
  3. Bruce

    Bruce DiscountASP.NET Staff

  4. dav

    dav

    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.ToString());
     
  5. 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
     
  6. dav

    dav

    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.
     
  7. excellent! Source is included, so if you have any additions to make, let me know :)


    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     
  8. ...That's pretty slick Bro, I'm gonna give it a try myself. [​IMG]
     

Share This Page