我使用visual studio 2010和.N ET 4.0创建了一个非常简单的窗口服务.
除了添加了安装程序之外,此服务没有从默认的Windows服务项目添加任何功能.
如果我在我的开发箱或我们域中的其他Windows 2008 R2计算机上运行"installutil.exe appName.exe",则Windows服务安装没有问题.
当我尝试在我们的客户站点上执行相同的操作时,它无法安装,并出现以下错误.
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).
Run Code Online (Sandbox Code Playgroud)
此解决方案只有一个项目,并且没有添加依赖项.
我在我们环境中的多台机器上尝试过,在客户中尝试过两台.这些机器都是windows 2008 R2,都是全新安装.一台机器只有.net 2.0和.net 4.0.另一个.net 2,3,3.5和4.
我是每台机器上的本地管理员.
我也尝试了64位安装程序,但得到以下错误,所以我认为32位的是一个使用的.
System.BadImageFormatException
任何指导将不胜感激.谢谢.