I have a need to play sound via the sound card of server PC while nobody is logged into the server. In years past, I have done this with some unmanaged code running as a service. Because of the way I was creating the service (VB6 with a wrapper) I was able to use a form with a Media Player control on it to play the sound. I then simply had the service running under a user account instead of the system account.
In .NET, I can create a service without a wrapper, obviously. However, you can't use the Media Player control without a form (as I understand it) and you can't create a form without setting the "Allow Service to Interact with Desktop" toggle which is generally bad practice. Also, I'm not sure that even that would work if there was nobody logged into the server. This has to be playing at all times and needs to have the recovery options that a service has.
Anybody had a need to do this and thought of a better way? FYI, I am required to write this in VB.NET or C#.NET.
Thanks!