无法安装Windows服务 [英] Cannot install windows service

查看:423
本文介绍了无法安装Windows服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Visual Studio 2010和.NET 4.0中创造了一个非常简单的窗口服务。

I have created a very simple window service using visual studio 2010 and .Net 4.0.

此服务没有任何功能,从默认的Windows服务项目增加,除了安装程序已被添加。

This service has no functionality added from the default windows service project, other than an installer has been added.

如果我在我的开发框或其它窗口运行installutil.exe appName.exe 2008 R2机器在我们的领域的窗口服务没有问题的安装。

If i run installutil.exe appName.exe on my dev box or other windows 2008 R2 machines in our domain the windows service installs without issue.

当我尝试做同样的事情在我们的客户网站,它安装失败,出现以下错误。

When i try to do this same thing on our customer site, it fails to install with the following error.

Microsoft (R) .NET Framework Installation utility Version 4.0.30319.1
Copyright (c) Microsoft Corporation.  All rights reserved.

Exception occurred while initializing the installation:
System.IO.FileLoadException: Could not load file or assembly 'file:///C:\TestService\WindowsService1.exe' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515).

该解决方案只有1个项目,并没有依赖性增加。

This solution has only 1 project and no dependencies added.

我已经尝试过在我们的环境和多台机器两个客户。该机器是所有Windows 2008 R2,这两个全新安装。一体机刚刚.NET 2.0和.NET 4.0。其他达网络2,3,3.5和4。

I have tried it on multiple machines in our environment and two in our customers. The machines are all windows 2008 R2, both fresh installs. One machine has just .net 2.0 and .net 4.0. The other .net 2, 3, 3.5 and 4.

我在每台计算机的本地管理员。

I am a local admin on each of the machines.

我也尝试了64位安装,但出现以下错误,所以我觉得32位的是一个使用。 System.BadImageFormatException

I have also tried the 64bit installer but get the following error, so i think the 32 bit one is the one to use. System.BadImageFormatException

任何指导,将AP preciated。谢谢你。

Any guidance would be appreciated. Thanks.

推荐答案

您可以尝试做一个安装项目为您服务,并运行该服务器上的MSI文件。

You can try to make a Setup Project for your service and run the MSI file on that server.

这篇关于无法安装Windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆