开发者

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

Running the code on my local box is running just fine. As soon as I load the code on my server it is having issues. I can't see the issues because my UI code is calling a webservice via jquery and the webservice is calling into the .cs file that is having an issu开发者_C百科es. The webservice just returns a failure to the jquery.

Any ideas or help is greatly appreciated.


Use the Remote Debugging tools to attach to the W3WP process on the server.


In short, you will need to add lots of logging in the area of code which is behaving oddly to give you clues as to what is happening on the server.

If the webservice is running on ASP.NET, you can use the built-in logging by enabling trace in your Web.config, and then logging likethis : HttpContext.Current.Trace.Write("hello");. All of the HTTP queries and your custom logging can then be viewed by going to http://host/Trace.axd

If not on ASP.NET you can either use a library like log4net or roll your own.


Although you could use Yuriy's approach, i wouldn't recommend it since debugging any process as such in production will ensure than none of your other pages will execute during that time since you would have hit the breakpoint.

Add Debug statements inside your Web Service... something like System.Diagnostics.Debug.WriteLine("write more information here");

Run DebugView on the Production server.

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

Hope this helps, Rahul

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜