How do you run a DART application as a windows ser

2019-07-21 17:38发布

问题:

I've been researching the possibility of using the DART language for my next project. The only thing really holding me back at this point is that I'm unable to find a way to run a DART application as a windows service. I have run searches on Google and read through much of the documentation on the DART website. Most of the information I found was related to creating a server in DART but nothing regarding windows services.

Can someone either point me at directions or detail the steps necessary to do so?

Thanks, Jon

回答1:

There's no difference in using Dart for a Windows service as any other executable; you just need to call dart.exe with the correct arguments.

However, Windows doesn't support running arbitrary exes as Windows Services, as they require a little metadata/bootstrapping. I've had good experiences with NSSM - the Non-Sucking Service Manager. In the comments, SC.exe was suggested; but I was unable to get it running on the latest version of Windows Server :(