I keep getting this error when I deploy my application in the server machine (Windows 7, IIS 7).
“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.”
The problem is I dont have any MessageBox call inside the code. What I did is, generated a DLL from PowerBuilder 12 and added the DLL in a .NET website to generate some reports. Any solution to this? Let me know if you need me to provide any other information. I really need help on this.
Heres the stacktrace:
[InvalidOperationException: 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.]
System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String
text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon,
MessageBoxDefaultButton defaultButton, MessageBoxOptions options,
Boolean showHelp) +2661926
System.Windows.Forms.MessageBox.Show(String text) +37
c__app_web_main.InitAssembly() +168 APP_WEB.n_app_web_main..ctor()
+18 ASP_TEST.getobject.GetData(String queryString) in
C:\Projects\ERP\ASP_TEST\ASP_TEST\getobject.aspx.cs:29
ASP_TEST.getobject.Page_Load(Object sender, EventArgs e) in
C:\Projects\ERP\ASP_TEST\ASP_TEST\getobject.aspx.cs:20
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object
o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,
EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+627
EDIT:
The problem occurs when I’m initializing the PB generated assembly, its throwing me an exception and trying to warn me with a messagebox. The assembly works fine in my local pc and my colleagues, so there has to be some security setting in IIS which is causing this problem.
This problem was solved by signing the custom DLL generated from PowerBuilder 12 with a key .