Error installing Windows Service using InstallUtil.exe

I am having problems installing my Windows service.

I followed Matt's instructions for creating my service: The easiest language to create a Windows service

ServiceAccount has User installed, although I tried LocalService, LocalSystem, and NetworkService.

The goal of my Windows service is to create a host for my WCF service.

I am running Win 7 64-bit Prof.

In PowerShell w / Admin Privelages, I ran the following:

PS C:\windows\Microsoft.NET\Framework64\v2.0.50727> ./installutil "H:\<omitted>\Host Windows Service.exe" 

I got the following error:

 Microsoft (R) .NET Framework Installation utility Version 2.0.50727.4927 Copyright (c) Microsoft Corporation. All rights reserved. Running a transacted installation. Beginning the Install phase of the installation. See the contents of the log file for the H:\<omitted>\Host Windows Service.exe assembly progress. The file is located at H:\<omitted>\Host Windows Service.InstallLog. Installing assembly 'H:\<omitted>\Host Windows Service.exe'. Affected parameters are: assemblypath = H:\<omitted>\Host Windows Service.exe logfile = H:\<omitted>\Host Windows S ervice.InstallLog logtoconsole = Unable to create an instance of the Host_Windows_Service.ProjectInstaller installer type. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. The inner exception System.Security.SecurityException was thrown with the following error message: That assembly does no t allow partially trusted callers.. An exception occurred during the Install phase. System.InvalidOperationException: Unable to create an instance of the Host_Windows_Service.ProjectInstaller installer ty pe. The inner exception System.Reflection.TargetInvocationException was thrown with the following error message: Exception h as been thrown by the target of an invocation.. The inner exception System.Security.SecurityException was thrown with the following error message: That assembly does no t allow partially trusted callers.. The Rollback phase of the installation is beginning. See the contents of the log file for the H:\<omitted>\Host Windows Service.exe assembly progress. The file is located at H:\<omitted>\Host Windows Service.InstallLog. Rolling back assembly 'H:\<omitted>\Host Windows Service.exe'. Affected parameters are: assemblypath = H:\<omitted>\Host Windows Service.exe logfile = H:\<omitted>\Host Windows Service.InstallLog logtoconsole = Unable to create an instance of the Host_Windows_Service.ProjectInstaller installer type. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. The inner exception System.Security.SecurityException was thrown with the following error message: That assembly does no t allow partially trusted callers.. An exception occurred during the Rollback phase of the System.Configuration.Install.AssemblyInstaller installer. System.InvalidOperationException: Unable to create an instance of the Host_Windows_Service.ProjectInstaller installer ty pe. The inner exception System.Reflection.TargetInvocationException was thrown with the following error message: Exception h as been thrown by the target of an invocation.. The inner exception System.Security.SecurityException was thrown with the following error message: That assembly does no t allow partially trusted callers.. An exception occurred during the Rollback phase of the installation. This exception will be ignored and the rollback wil l continue. However, the machine might not fully revert to its initial state after the rollback is complete. The Rollback phase completed successfully. The transacted install has completed. The installation failed, and the rollback has been performed. 

I even tried disabling UAC with no luck at all. Please let me know if you need more information.

I am tempted to use the Matt method to install the Windows service here: How to start the Windows.NET service immediately after installation? . Although, I am worried that I will encounter similar problems.

thanks

+6
source share
1 answer

Try transferring the service and its dependencies to C: drive and try again, especially if H: is a network drive.

+3
source

Source: https://habr.com/ru/post/889485/


All Articles