当应用程序未在用户交互模式下运行时显示模式对话框或表单我... [英] Showing a modal dialog box or form when the application is not running in User Interactive mode i...

查看:142
本文介绍了当应用程序未在用户交互模式下运行时显示模式对话框或表单我...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当应用程序未在UserInteractive模式下运行时显示模式对话框或表单不是有效操作。指定ServiceNotification或DefaultDesktopOnly样式以显示来自服务应用程序的通知。



i我收到此错误我删除了消息框我还删除了system.windows.forms dll是pres

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 am gettingn this error I have removed the message box i also removed the system.windows.forms dll which was pres

推荐答案

这是因为您的应用程序将其命名为Windows服务。此应用程序类型不是交互式的。但有些奇怪的原因,你决定可以使用UI,但你根本不能。它没有任何意义:服务应该在您注销时运行,此时桌面在哪里。



忘掉用户界面。



-SA
This is because your application type it the Windows Service. This application type is not interactive. But some weird reason, you decided that you can use UI with it, but you simply cannot. And it would not make any sense: the service should be running when you log out, and where is the desktop at this time.

Just forget about UI.

—SA


这篇关于当应用程序未在用户交互模式下运行时显示模式对话框或表单我...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆