How do I debug a .cs code file while running on a server?

Running code in my local field is fine. As soon as I download the code on my server, it has problems. I see no problems because my user interface code calls the web service via jquery and the web service calls to the .cs file which has problems. Webservice just returns jQuery crash.

Any ideas or help are appreciated.

+4
source share
3 answers

In short, you will need to add a lot of logs to the area of ​​code, which behaves strangely to give you hints as to what is happening on the server.

If the web service runs on ASP.NET, you can use the built-in log by enabling tracing in your Web.config and then running the following command: HttpContext.Current.Trace.Write("hello"); . Then all HTTP requests and user logging can be viewed by going to http: //host/Trace.axd

If you are not using ASP.NET, you can use a library like log4net, or flip your own.

+2
source

Use Remote Debugging to connect to the W3WP process on the server.

+4
source

Although you could use the Yuri approach, I would not recommend it, since debugging any process as such in production will ensure that none of your other pages run during this time, since you would hit the breakpoint.

Add debug statements inside your web service ... something like System.Diagnostics.Debug.WriteLine("write more information here");

Launch DebugView on the Production server.

http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx

Hope this helps, Rahul

+2
source

All Articles