简体   繁体   中英

What is the best method of remotely controlling/debugging a .NET application?

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 (ie 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.

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 .

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM