【发布时间】:2010-11-28 11:44:07
【问题描述】:
我已经编写了一个 Windows 服务,但是当我安装它时出现了 system.security.securityexception。我认为是因为我从 user32.dll 导入了一个函数,但我不知道。 谁能帮帮我?
编辑:
安装日志:
对不起语言。
Während der Installationsphase ist eine Ausnahme aufgetreten。 System.Security.SecurityException: Die Quelle wurde nicht gefunden, aber einige oder alle Ereignisprotokolle konnten nicht durchsucht werden。 Protokolle, auf die kein Zugriff möglich 战争:安全。
【问题讨论】:
-
您可以发布安装日志文件吗?堆栈跟踪表明它是
System.Security.SecurityException?您的代码也不会受到伤害。我有一些猜测,但目前仅此而已。 -
这个异常是在安装服务时还是在安装成功后服务尝试启动时出现的?
-
@mOsa 使用 installutil 安装时发生异常
-
如果是 Windows 7,您必须以管理员身份运行命令行,否则它不会“捕获”。不过,我们仍然需要看到完整的错误,就像 Cody 上面问的那样。
-
异常文本的翻译:
During installation, an exception has occurred. System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Protocols to which access was not possible: Security
标签: c# windows-services