gpt4 book ai didi

wcf - 使用 InstallUtil.exe 安装 Windows 服务时出错

转载 作者:行者123 更新时间:2023-12-03 15:08:29 25 4
gpt4 key购买 nike

我在安装 Windows 服务时遇到了一些问题。

我按照 Matt 在此处的说明创建了我的服务:
Easiest language for creating a Windows service

ServiceAccount 设置为 User,虽然我尝试过 LocalService、LocalSystem 和 NetworkService。

我的 Windows 服务的目的是为我的 WCF 服务创建一个主机。我正在运行 Win 7 64 位 Prof.

我在带有管理员权限的 PowerShell 中运行了以下命令:

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

我收到以下错误:
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's 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's 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.

我什至尝试在没有运气的情况下完全禁用 UAC。如果您需要更多信息,请告诉我。

我很想在这里使用 Matt 的方法来安装 Windows 服务: How to make a .NET Windows Service start right after the installation? .虽然,我担心我会遇到类似的问题。

谢谢

最佳答案

尝试将服务及其依赖项移动到 C: 驱动器并重试,尤其是当 H: 是网络驱动器时。

关于wcf - 使用 InstallUtil.exe 安装 Windows 服务时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6192478/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com