Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Windows服务安装失败:无法获取安装程序类型_C#_.net_Service_Windows Services_Installutil - Fatal编程技术网

C# Windows服务安装失败:无法获取安装程序类型

C# Windows服务安装失败:无法获取安装程序类型,c#,.net,service,windows-services,installutil,C#,.net,Service,Windows Services,Installutil,我已经开发了一个Windows服务,我已经完成了以下工作: 添加了安装程序 确保ServiceInstaller1中的ServiceName属性与我的服务名称匹配 设置正确的参数 将项目属性中的启动更改为serviceName.Program 以管理员身份启动VS命令工具 但是,即使在所有这些之后,使用Installutil安装服务也会失败,并出现以下错误: 安装程序集“C:\Users\\Documents\Visual Studio 2013\Projects\TestLicenseServ

我已经开发了一个
Windows服务
,我已经完成了以下工作:

  • 添加了
    安装程序
  • 确保
    ServiceInstaller
    1中的
    ServiceName
    属性与我的服务名称匹配
  • 设置正确的参数
  • 将项目属性中的启动更改为
    serviceName.Program
  • 以管理员身份启动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

    请告知