【问题标题】:Can't install windows service无法安装windows服务
【发布时间】: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


【解决方案1】:

如果是 Windows 7 或 Vista,你必须以管理员身份运行命令行,否则它不会“捕获”。

为此,请单击 Windows 按钮或启动“Orb”,键入“cmd”,然后按 CTRL+SHIFT+Enter 键而不是按 Enter 键并确认对话框。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-16
    相关资源
    最近更新 更多