I have an application which runs in hidden mode. In new version I need to update database that is why I need to show some form to get some data from user for update. I use Form.ShowDialog method but errors occurred. It is said in error that
"Showing 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 guess that I need to show form in other way but I don't know how.
It works fine when i run this, i guess i should call it server, manually. But when another service starts it code:
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(path);
startInfo.WorkingDirectory = ServerModel.ServerInfo.ServerDir;
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
System.Diagnostics.Process.Start(startInfo);
This error occurs.
I would suggest to use windows balloon notifications, as they are mean't for showing messages from hidden apps.
See this link for reference.
As the error message says you have to set the options of MessageBox.Show to either ServiceNotification or DefaultDesktopOnly. This applies to a MessageBox you probably try to show in your application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With