如何在实时服务器上调试 asp.net 应用程序 [英] How to debug an asp.net application on live server

查看:45
本文介绍了如何在实时服务器上调试 asp.net 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于 .net framework 1.1 的旧 asp.net web 应用程序,它已经部署到实时服务器多年,现在我只有实时站点有一些问题,我桌面上的开发版本有效美好的.所以我正在考虑将远程调试器附加到实时站点并监控实时服务器上发生的事情,但我不知道该怎么做.

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.

推荐答案

是的,这是可能的,但涉及更多.您需要附加到运行网站的 IIS 工作进程 (w3wp.exe).我不经常这样做,我通常会尽量避免它,因为当您附加时,没有人可以访问该网站.

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

这篇文章基于 2.0 而不是 1.1,但它仍然应该让您知道如何去做.我想你必须在生产服务器上有 Visual Studio.

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.

您可能想查看 log4net,这是一个免费的日志记录应用程序.

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

祝你好运

这篇关于如何在实时服务器上调试 asp.net 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆