Sup*_*NES 24 .net c# windows-services failed-installation
所以我在C#中构建了一个服务,我正在尝试使用以下命令来安装它:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\installutil.exe MyService.exe >> installLog.txt
Run Code Online (Sandbox Code Playgroud)
它失败.当我查看installLog.txt时,我得到了这个:
Microsoft (R) .NET Framework Installation utility Version 2.0.50727.3053
Copyright (c) Microsoft Corporation. All rights reserved.
Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\MyService.exe' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded..
Run Code Online (Sandbox Code Playgroud)
相同的方法适用于安装不同的组件.我觉得可能是因为失败的那个是为.NET 4.0编写的,而有效的是3.5.
有没有人有这个问题的经验?
Dar*_*ten 42
您正在使用错误的installutil.exe如果您的应用程序是针对.Net 4.0构建的.使用4.0文件夹中的installutil.exe.
C:\ WINDOWS\Microsoft.NET\Framework64\v4.0.30319\installutil.exe
Stu*_*Stu 15
对于那些没有找到解决问题的人,你需要查看.vdproj文件的启动条件并将.NET框架更改为4:http://www.alexjamesbrown.com/uncategorized/deploying-净-4-项目误差-1001-系统badimageformatexception /
| 归档时间: |
|
| 查看次数: |
50196 次 |
| 最近记录: |