如何在登台服务器中调试 .net dll 程序集
有没有一种方法或工具可以在临时服务器中调试 .net dll 程序集。我在登台服务器上部署了 ASP.NET Web dll。
更新
- 在代码中实现调试逻辑以关闭/打开调试。 (来自@maple_shaft)
- ASP.NET 远程调试。 (来自@maple_shaft)
问题:
- ASP.NET 中是否有一个跟踪选项,可以在 *.config 文件上关闭/打开,允许显示每个正在运行的类,如 *.ASPX 跟踪功能。
任何想法将不胜感激。
Is there a way or tool by which I can debug .net dll assemblies in staging server. I have a ASP.NET web dlls deployed on staging server.
Updates
- Implementing debugging logic within code to turn off/on debugging. (from @maple_shaft)
- ASP.NET Remote debugging. (from @maple_shaft)
Question:
- Is there a trace option in ASP.NET which can be turned off/on on *.config file, allows display of every class is running, like *.ASPX trace function.
Any idea would be very much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你检查过WinDbg(Windows调试工具的一部分,现在是Windows SDK的一部分)吗?
我在发布环境中调试 .NET 应用程序方面没有太多经验,但我们很少遇到过这样的极端情况:本机代码中的问题只会出现在客户计算机上,并且无法在其他任何地方重复。放置 WinDbg 以及少量所需的源文件和调试符号,使我们能够直接在客户环境中解决这些问题。
have you checked out WinDbg (part of Debugging Tools for Windows, which is now part of Windows SDK)?
I don't have as much experience with debugging .NET apps in release environment, but we had few extreme cases where a problem in native code would only occur on customer machines and couldn't be duplicated anywhere else. Placing WinDbg, along with few needed source files and debug symbols, allowed us to solve those issues directly in customer environment.
最好的方法是将日志记录代码放在整个代码中,以便您可以在日志记录配置中切换到调试级别。
除了可以使用 Visual Studio 远程完成真正的调试之外,还有一些先决条件:
1) 部署到暂存的程序集必须在调试模式下构建。
2) 您必须为临时服务器上打开的远程调试端口设置适当的防火墙例外。
部署在登台上的应用程序可能是在发布模式下构建的,因此无法远程执行此操作,但是您始终可以在调试模式下构建部署并手动重新部署到服务器来执行此操作。
就防火墙例外而言,您必须通过组织中的正确渠道才能获得为您制定的防火墙例外(如果需要)。
The best way is to put logging code throughout your code so that you can switch to the debug level in your logging configuration.
Apart from this true debugging can be done remotely using Visual Studio, however there are some prerequisites:
1) Your assemblies deployed to staging must be built in Debug mode.
2) You must have the appropriate firewall exceptions for the remote debugging ports open on the staging server.
Your app deployed on staging is probably built in Release mode, making it impossible to do remotely, however you can always build a deployment in Debug mode and manually redeploy to your server to do this.
As far as firewall exceptions go, you will have to go through the right channels in your organization to get firewall exceptions made for you if they are needed.