相关疑难解决方法(0)

Exe 安装抛出错误模块应包含程序集清单 .Net Core

我已经实现了windows service使用.Net Core worker service. 从命令提示符安装服务时出现错误

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>InstallUtil.exe D:\LC\WindowService\L3WorkerService.exe
Microsoft (R) .NET Framework Installation utility Version 4.8.3752.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 
'file:///D:\LC\WindowService\L3WorkerService.exe' or one of its dependencies. 
The module was expected to contain an assembly manifest..
Run Code Online (Sandbox Code Playgroud)

我尝试过这两条路径

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>InstallUtil.exe D:\LC\WindowService\L3WorkerService.exe
C:\Windows\Microsoft.NET\Framework\v4.0.30319>InstallUtil.exe D:\LC\WindowService\L3WorkerService.exe
Run Code Online (Sandbox Code Playgroud)

这是我的项目信息

  • 平台目标 - x86
  • 输出类型 - WindowsApplication
  • 目标框架 - .NET Core 3.1

我该如何解决这个问题?

.net c# windows-services .net-core

6
推荐指数
1
解决办法
5364
查看次数

标签 统计

.net ×1

.net-core ×1

c# ×1

windows-services ×1