I am working on project. In my System when I run the project it is running nicely, but after uploading it to my domain when I check, then it displays the error like:
"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."
if (printDialog.ShowDialog() == DialogResult.OK)
{
printDocument.PrinterSettings = printDialog.PrinterSettings;
printDocument.PrintPage += OnPrintPage;
foreach (var file in myarray)
{
System.Drawing.Image img = Bitmap.FromFile(file);
Bitmap bmp = new Bitmap(img);
ResuletImage = bmp;
printDocument.DefaultPageSettings.Landscape = true;
printDocument.PrinterSettings.PrinterName = default;
printDocument.DocumentName = file;
printDocument.Print();
}
}