Can this be used in Windows Server 2012 R2 to kick off external applications (eg. Console apps)

103 views
Skip to first unread message

OCL

unread,
Dec 12, 2016, 11:27:09 AM12/12/16
to topshelf-discuss
That was one reason why we moved away from a Windows service approach. A Windows service running on Server 2012 does not support instantiating another process (eg. Console app). Does Topshelf support this ?

Thanks !

Dru Sellers

unread,
Dec 12, 2016, 1:09:12 PM12/12/16
to topshelf...@googlegroups.com
By default no, but it is .net code so it can do pretty much anything. Tell me a bit more about what you are trying to do.

On Mon, Dec 12, 2016 at 10:27 AM, OCL <padmanab...@gmail.com> wrote:
That was one reason why we moved away from a Windows service approach. A Windows service running on Server 2012 does not support instantiating another process (eg. Console app). Does Topshelf support this ?

Thanks !

--
You received this message because you are subscribed to the Google Groups "topshelf-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topshelf-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

OCL

unread,
Dec 13, 2016, 12:48:08 PM12/13/16
to topshelf-discuss
Sure. We have a process (intended initially to run as a service) which polls an Amazon queue (SQS) for messages. It gets the message and puts that into the datastore and starts another application, a console app. The console app reads from the datastore and does what it does best. 

The challenge that we face is that while a WIndows service based approach works great on the dev machines (Windows 7), on the deploy boxes it does not. Because Windows 2012 R2 strictly enforces the "cannot interact with desktop applications" rule. 

We tried various workarounds like hiding the windows etc. and while this seems to work in Windows 7, not so much on server based OSs. So, we have implemented this as a long-running process on the server .... which somehow seems cludgy and does not look pretty in the Prod environment.

Hence we are evaluating various service based frameworks like TopShelf, Hangfire etc. 


On Monday, December 12, 2016 at 12:09:12 PM UTC-6, Dru wrote:
By default no, but it is .net code so it can do pretty much anything. Tell me a bit more about what you are trying to do.
On Mon, Dec 12, 2016 at 10:27 AM, OCL <padmanab...@gmail.com> wrote:
That was one reason why we moved away from a Windows service approach. A Windows service running on Server 2012 does not support instantiating another process (eg. Console app). Does Topshelf support this ?

Thanks !

--
You received this message because you are subscribed to the Google Groups "topshelf-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topshelf-discu...@googlegroups.com.

Dru Sellers

unread,
Dec 13, 2016, 2:38:35 PM12/13/16
to topshelf...@googlegroups.com
So, if I was going to make up a solution I would do a scheduled job using something like Quartz as a service to give you the timer.

You could then fire a message at a MassTransit bus that would pick up the data and run your process. 

You would have 2 windows services - one as the timer and one as the work.

Just an idea.

But TS won't provide anything special around getting around the interact with desktop apps.

-d


To unsubscribe from this group and stop receiving emails from it, send an email to topshelf-discuss+unsubscribe@googlegroups.com.

Patrick Le Breton

unread,
Oct 25, 2017, 1:00:47 PM10/25/17
to topshelf-discuss


On Monday, 12 December 2016 16:27:09 UTC, OCL wrote:
That was one reason why we moved away from a Windows service approach. A Windows service running on Server 2012 does not support instantiating another process (eg. Console app). Does Topshelf support this ?

Thanks !

This is actually not a topshelf issue but a Windows trick to know of.
To do that follow the follwing steps;
Create a topshelf service
Enumerate the user sessions and pick the one that is interactive.
Get its security token.
Use CreateProcessAsUser to launch your desktop or console application from your service.
NB: your service must run under local system account.
Reply all
Reply to author
Forward
0 new messages