3

我开发了一个Windows Service,我做了以下事情:

  1. 添加了Installer
  2. 确保 1 中的ServiceName属性ServiceInstaller与我的服务名称匹配
  3. 设置正确的参数
  4. 将项目属性中的启动更改为 serviceName.Program
  5. 以管理员身份启动 VS 命令工具。

然而,即使在这一切之后,服务的安装,使用Installutil失败,给出以下错误:

安装程序集“C:\Users\\Documents\Visual Studio 2013\Projects\TestLicenseService\TestLicenseService\bin\Debug\TestLicenseService.exe”。受影响的参数是:logtoconsole = logfile = C:\Users\\Documents\Visual Studio 2013\Projects\TestLicenseService\TestLicenseService\bin\Debug\TestLicenseService.InstallLog assemblypath = C:\Users\\Documents\Visual Studio 2013\Projects\TestLicenseService \TestLicenseService\bin\Debug\TestLicenseService.exe 尝试在 C:\Users\\Documents\Visual Studio 2013\Projects\TestLicenseService\TestLicenseService\bin\Debug\TestLicenseService.exe 程序集中查找安装程序时发生异常。System.Reflection.ReflectionTypeLoadException:无法加载一种或多种请求的类型。检索 LoaderExceptions 属性以获取更多信息。

所有相关的依赖项都存在于正确的文件夹中,但它不会安装该服务。可能是什么问题?

使用 VS2013 和 Windows 8.1。

好心提醒。

4

0 回答 0