远程控制/调试 .NET 应用程序的最佳方法是什么?

发布于 2024-11-03 02:46:41 字数 481 浏览 1 评论 0原文

我每天 24 小时在专用机器上运行 VB.NET 应用程序。我希望能够接收状态更新并远程控制/调试应用程序(即通过互联网从另一台计算机)。

如果通信是轻量级的(就发送和接收的字节而言),这将是一个优势,这样我就可以控制事物而无需快速的互联网连接。另外,我目前正在 IDE 中运行应用程序,因为存在一些未处理的异常,并且这种方式更容易调试。如果我不必编译它并捕获所有错误,那就太好了。

设置此类内容的最简单方法是什么?在安全方面我需要注意什么?

任何进一步阅读的想法或指示将不胜感激。

更新

澄清我需要为应用程序提供哪些输入 - 理论上不需要。如果一切按计划进行,我只需关闭应用程序并阅读某种日志就可以了。问题是它不稳定(主要是因为它调用一个非常不稳定的网络服务并返回各种奇怪的东西),因此似乎需要我不断的输入。

我认为,远程进行此类调试的唯一方法是捕获所有可能的错误,读取日志,并以某种方式指示应用程序将来正常运行。

I'm running a VB.NET application 24 hours a day on a dedicated machine. I'd like to be able to receive status updates and also control/debug the application remotely (i.e. from another computer via the internet).

It would be an advantage if the communication was lightweight (in terms of bytes sent and received) so I can control the thing without needing a fast internet connection. Also, I'm running the application from within the IDE at the moment because there are some unhandled exceptions and it's easier to debug this way. It would be nice if I didn't have to compile it and catch all the errors.

What is the easiest way to set something like this up, and what do I need to be aware of in terms of security?

Any ideas or pointers to further reading would be appreciated.

Update

To clarify what input I need to give the application - in theory, none. If all went to plan I'd just set the application off and reading some sort of log would be fine. The problem is that it is unstable (mainly because it calls a web service which is very unstable and returns all sorts of weird things) and therefore seems to need constant input on my part.

It was my thinking that the only way I could do this sort of debugging remotely is by catching every error I could, reading the log, and somehow instructing the application to behave properly in future.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

江南月 2024-11-10 02:46:41

这里有很多开放性的内容,但以下是我的想法:

您通过 IDE 运行应用程序来进行调试的事实表明,当应用程序终止时您没有获得足够的调试信息。在尝试解决此问题之前,请通过 解决此问题在适当的位置尝试/捕获,并记录相关信息 到 EventLog。然后可以从远程计算机读取日志。

对于远程监控和控制,如果没有有关您的应用程序的更多信息,真的很难判断什么是最简单的解决方案。需要通过界面完成什么操作,您有哪些访问限制,...?

根据有限的信息,我建议编写一个小型 Web 应用程序来控制您的应用程序 - 嵌入到应用程序中或作为通过其他方式控制它的小型服务。通过这种方式,您可以受益于网络技术和安全设置众所周知的事实。

编辑:
从您的更新来看,您似乎正在寻找 远程调试器

There are a lot of open ends here, but here are my thoughts:

The fact that you are running the application via the IDE to get debugging indicate that you aren't getting enough debugging information when the application dies. Look into resolving this before trying to work around it by try/catch-ing on appropriate places, and log relevant info to the EventLog. The log can then be read from a remote machine.

For monitoring and controlling remotely, it is really hard to tell what is the simplest solution without more information about your app. What needs to be done via the interface, what access constraints do you have,...?

Based on the limited information, I'd suggest writing a small web application to control your app - either embedded in the application or as a small service controlling it by some other means. This way you benefit from the fact that web techniques and security settings are well known.

Edit:
Judging by your update it seems like you are looking for a remote debugger.

任谁 2024-11-10 02:46:41

嗯...我不认为你需要开发解决方案...这听起来像一个在服务器上运行的 winapp。

您是否考虑在目标计算机上安装 teamviewer,或者只是使用 Windows RDC?

Hmm... I don't think you need to develop a solution... This sounds like a winapp running on a server.

Did you consider installing teamviewer on the target machine, or simply using Windows RDC?

清浅ˋ旧时光 2024-11-10 02:46:41

如果您正在使用像 log4net 或 nlog 这样的日志框架(如果您进行日志记录,则应该这样做),您可以轻松地使用远程附加程序。例如,log4net 提供了一个远程附加程序,它通过 tcp 将日志条目发送到远程服务器,您可以在其中编写一个小型看门狗类型的应用程序来监视您的系统。

如果您需要更简单的解决方案,您可以使用电子邮件附加程序,将所有错误邮寄给您。

If you are using a logging framework like log4net or nlog you (which you should if you do logging) you can easily use a remote appender. log4net for example provides a remote appender which sends log entries via tcp to a remote server where you can write a small watchdog type app to monitor your system.

If you need a simpler solution you can use an email appender which mails all errors to you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文