在特定计算机上安装Windows服务失败?

女妖

我有一个装有以下代码(bat文件)的Windows服务:

@ECHO OFF

REM The following directory is for .NET 4.0
set DOTNETFX2=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319
set PATH=%PATH%;%DOTNETFX2%

echo Installing IEPPAMS Win Service...
echo ---------------------------------------------------
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil "%~dp0MyApp5.WindowsService.exe"
echo ---------------------------------------------------
pause
echo Done.

在几乎所有运行Windows Server的计算机上,此方法都适用。有时,bat文件必须重新保存为ANSI或UTF8,但之后在大多数情况下仍可以工作。

但是,我遇到了Windows Server 2012计算机,在使用install.but fil时出现以下异常:

Installing IEPPAMS Win Service...
---------------------------------------------------
Microsoft (R) .NET Framework Installation utility Version 4.0.30319.18010
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 C:\MyAppService54\MyApp5.WindowsService
.exe assembly's progress.
The file is located at C:\MyAppService54\MyApp5.WindowsService.InstallLog.
Installing assembly 'C:\MyAppService54\MyApp5.WindowsService.exe'.
Affected parameters are:
   logtoconsole =
   assemblypath = C:\MyAppService54\MyApp5.WindowsService.exe
   logfile = C:\MyAppService54\MyApp5.WindowsService.InstallLog
Unable to create an instance of the MyApp5.WindowsService.ProjectInstaller insta
ller type.
System.Reflection.TargetInvocationException: Exception has been thrown by the ta
rget of an invocation.
The inner exception System.NullReferenceException was thrown with the following
error message: Object reference not set to an instance of an object..

An exception occurred during the Install phase.
System.InvalidOperationException: Unable to create an instance of the MyApp5.Win
dowsService.ProjectInstaller installer type.
The inner exception System.Reflection.TargetInvocationException was thrown with
the following error message: Exception has been thrown by the target of an invoc
ation..
The inner exception System.NullReferenceException was thrown with the following
error message: Object reference not set to an instance of an object..

The Rollback phase of the installation is beginning.
See the contents of the log file for the C:\MyAppService54\MyApp5.WindowsService
.exe assembly's progress.
The file is located at C:\MyAppService54\MyApp5.WindowsService.InstallLog.
Rolling back assembly 'C:\MyAppService54\MyApp5.WindowsService.exe'.
Affected parameters are:
   logtoconsole =
   assemblypath = C:\MyAppService54\MyApp5.WindowsService.exe
   logfile = C:\MyAppService54\MyApp5.WindowsService.InstallLog
Unable to create an instance of the MyApp5.WindowsService.ProjectInstaller insta
ller type.
System.Reflection.TargetInvocationException: Exception has been thrown by the ta
rget of an invocation.
The inner exception System.NullReferenceException was thrown with the following
error message: Object reference not set to an instance of an object..
An exception occurred during the Rollback phase of the System.Configuration.Inst
all.AssemblyInstaller installer.
System.InvalidOperationException: Unable to create an instance of the MyApp5.Win
dowsService.ProjectInstaller installer type.
The inner exception System.Reflection.TargetInvocationException was thrown with
the following error message: Exception has been thrown by the target of an invoc
ation..
The inner exception System.NullReferenceException was thrown with the following
error message: Object reference not set to an instance of an object..
An exception occurred during the Rollback phase of the installation. This except
ion will be ignored and the rollback will continue. However, the machine might n
ot 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.
---------------------------------------------------
Press any key to continue . . .

我看到它得到一个NullRef异常,但是我没有得到这个?在所有其他计算机上都可以正常工作。我知道这个特定的环境还有一些额外的安全规则,是吗?

女妖

通过在资源管理器中启用所有安全设置并重新下载即可正常工作。我不确定资源管理器如何能够基于安全性更改zip文件的内容。我知道阻止/取消阻止问题,但事实并非如此。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

列出Perforce中特定计算机上用户的工作空间

来自分类Dev

regedit-cmd仅显示闪烁的下划线,但仅在特定计算机上

来自分类Dev

Heroku上的Rails应用程序:特定计算机上的空白页

来自分类Dev

特定计算机上安装的PostgreSQL数据库表的描述

来自分类Dev

在Windows计算机上安装Git服务器

来自分类Dev

仅在特定计算机上调用Web服务时显示401

来自分类Dev

特定计算机上C#控制台应用程序的奇怪问题

来自分类Dev

HTTPoison请求在特定计算机上失败,但在另一台计算机上工作

来自分类Dev

SSH无法在一台特定计算机上运行

来自分类Dev

如何确定计算机上的MAC地址?

来自分类Dev

Git克隆错误“访问权限”仅在特定计算机上

来自分类Dev

根据用户名获取网络中特定计算机上的信息

来自分类Dev

无法在一台特定计算机上加载网页

来自分类Dev

网站在特定计算机上的加载速度缓慢(陈旧)

来自分类Dev

Windows服务无法通过MSI安装程序在几台计算机上安装

来自分类Dev

在特定计算机上下载速度慢

来自分类Dev

是否可以确认CD是在特定计算机上刻录的?

来自分类Dev

是否可以通过捆绑包将其部署到特定计算机上

来自分类Dev

为什么我无法在特定计算机上打开特定rar文件,但在其他计算机上打开该文件?

来自分类Dev

特定计算机上安装的PostgreSQL数据库表的描述

来自分类Dev

Sidekiq-防止在特定计算机上执行工作程序

来自分类Dev

如何使在特定计算机上安装新操作系统变得困难?

来自分类Dev

本地网站未加载到一台特定计算机上

来自分类Dev

使用C#以编程方式在远程计算机上安装Windows服务

来自分类Dev

如何配置php代码以在特定计算机上执行

来自分类Dev

ADAL:在特定计算机上获取令牌时出错

来自分类Dev

非UEFI计算机上的Windows 8.1安装失败,错误为0x80070570

来自分类Dev

Git LFS无法在特定计算机上克隆特定文件

来自分类Dev

仅在特定计算机上的 Delphi 访问冲突

Related 相关文章

  1. 1

    列出Perforce中特定计算机上用户的工作空间

  2. 2

    regedit-cmd仅显示闪烁的下划线,但仅在特定计算机上

  3. 3

    Heroku上的Rails应用程序:特定计算机上的空白页

  4. 4

    特定计算机上安装的PostgreSQL数据库表的描述

  5. 5

    在Windows计算机上安装Git服务器

  6. 6

    仅在特定计算机上调用Web服务时显示401

  7. 7

    特定计算机上C#控制台应用程序的奇怪问题

  8. 8

    HTTPoison请求在特定计算机上失败,但在另一台计算机上工作

  9. 9

    SSH无法在一台特定计算机上运行

  10. 10

    如何确定计算机上的MAC地址?

  11. 11

    Git克隆错误“访问权限”仅在特定计算机上

  12. 12

    根据用户名获取网络中特定计算机上的信息

  13. 13

    无法在一台特定计算机上加载网页

  14. 14

    网站在特定计算机上的加载速度缓慢(陈旧)

  15. 15

    Windows服务无法通过MSI安装程序在几台计算机上安装

  16. 16

    在特定计算机上下载速度慢

  17. 17

    是否可以确认CD是在特定计算机上刻录的?

  18. 18

    是否可以通过捆绑包将其部署到特定计算机上

  19. 19

    为什么我无法在特定计算机上打开特定rar文件,但在其他计算机上打开该文件?

  20. 20

    特定计算机上安装的PostgreSQL数据库表的描述

  21. 21

    Sidekiq-防止在特定计算机上执行工作程序

  22. 22

    如何使在特定计算机上安装新操作系统变得困难?

  23. 23

    本地网站未加载到一台特定计算机上

  24. 24

    使用C#以编程方式在远程计算机上安装Windows服务

  25. 25

    如何配置php代码以在特定计算机上执行

  26. 26

    ADAL:在特定计算机上获取令牌时出错

  27. 27

    非UEFI计算机上的Windows 8.1安装失败,错误为0x80070570

  28. 28

    Git LFS无法在特定计算机上克隆特定文件

  29. 29

    仅在特定计算机上的 Delphi 访问冲突

热门标签

归档