Tech Off Thread

2 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Interactive servicies

Back to Forum: Tech Off
  • User profile image

    In .NET SDK is information, that a Windows Service written under .NET cannot run in the interactive mode.
    But there is an option "Allow using desktop" under the service options, that enables this behaviour.
    By checking this option, you can show forms and dialog boxes from your service.

    My question is: Is it correct to check "Allow using desktop" option and showforms from .NET service?


  • User profile image

    A windows service which wants to display a user interface has to run under the SYSTEM account. This is a bad idea, because it's a very powerful account and most of the time it has more rights than you ever need, i.e. you would be violating the "Running with least privilege" principle. Furthermore, if such a service displays a window on a user's desktop it opens the possibility of the so-called "window message attack". I strongly recommend reading Keith Brown's "The .NET Developer's Guide to Windows Security". It contains some advice on how to display user interfaces from services, too.


Conversation locked

This conversation has been locked by the site admins. No new comments can be made.