C# Windows Interactive Service return Environment.UserInteractive wrong value

  • Thread starter Thread starter Hesion78
  • Start date Start date
H

Hesion78

Guest
Hello,

After many unsuccessful searches, I post a message to find a solution to my problem. I have a C# Windows service that has been running for many, many years without any problems. This service is an interactive service that displays an HMI. However, in recent months, I have more and more problems under Windows 10 and Windows Server 2016 that refuses to launch the service interactively.

When the service starts I get the following error message:


Displaying a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

I checked the value of the variable "Environment.UserInteractive" directly in C#, it returns "false".

In addition, when I check the configuration of the Windows service the box "Allow the service to interact with the desktop" is checked.

I do not understand where the problem comes from and especially where can I search?

I am on a C # Framework .NET 4.6.1 application and under Visual Studio 2015.

Thank you in advance for your assistance !

Continue reading...
 


Write your reply...
Back
Top