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.
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?
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());
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
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.
excellent! Source is included, so if you have any additions to make, let me know Joel Thoms DiscountASP.NET http://www.DiscountASP.NET
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