How to debug an asp.net application on live server [closed]

限于喜欢 提交于 2019-12-10 13:15:31

问题


I have an old asp.net web application based on .net framework 1.1, it has been deployed to live server for many years, right now I am having some issues with the live site only, the development version on my desktop works fine. So I am thinking about attach a remote debugger to the live site and monitor what happened exactly on live server, but I don't know how to do that.

I used remote debugger before, but that was used when I created new project on some development server in local LAN, and the source and project is actually on the remote server, I just attached remote debugger from my desktop to that server, it works fine. But I am not sure how to debug a application on live server.


回答1:


Well yes it is possible, but is more involved. You would need to attach to the IIS worker process running the website( w3wp.exe). I haven't done it very often, and I usually try to avoid it, because while you are attached no one can access the website.

Here is an article that explains the process.

http://www.codeproject.com/KB/aspnet/ProcessAttache.aspx

The article is based on 2.0 not 1.1, but it should still give you an idea of how to do it. I suppose you will have to have visual studio on the production server.

If this is not feasible and you have access to the code, you could also try logging to a text file at certain points in the application. I have done this very effectively to find issues, which allows you to let the website run as normal and just check the log file after you know the problem has occurred.

You may want to check out log4net, which is a free logging application.

Good luck




回答2:


Well, why don't you try to enable tracing on the server? Then you can see all of the information in a separate page? To enable in the web.config:

<configuration>
   <system.web>
     <trace enabled="true" pageOutput="false" requestLimit="40" 
        localOnly="false"/>
   </system.web>
</configuration>

Then load the trace.axd page in your website to see the page level data.



来源:https://stackoverflow.com/questions/1369829/how-to-debug-an-asp-net-application-on-live-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!