gpt4 book ai didi

c# - Windows 服务 : System. Reflection.ReflectionTypeLoadException 被抛出并出现以下错误消息:无法加载一个或多个重新

转载 作者:太空狗 更新时间:2023-10-29 20:36:39 25 4
gpt4 key购买 nike

我正在使用 Windows 服务,其中我有一个程序集的引用,该程序集是 copy local= false。但是我试图在运行时加载它,虽然当我从 visual studio 运行它时工作正常,但是当我尝试安装它时,cmd 给出了这个错误:

An exception occurred while trying to find the installers in the D:\Official\Pro
jects\20131007_ImproveDN\build\debug\application
s\SubscriptionService\SubscriptionService.exe assembly.
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the
requested types. Retrieve the LoaderExceptions property for more information.
Aborting installation for D:\Official\Projects\2
0131007_ImproveDN\build\debug\applications\SubscriptionService\SubscriptionServi
ce.exe.
An exception occurred during the Rollback phase of the System.Configuration.Inst
all.AssemblyInstaller installer.
System.InvalidOperationException: Unable to get installer types in the D:\Offici
al\Projects\\20131007_ImproveDN\build\debug\appli
cations\SubscriptionService\SubscriptionService.exe assembly.
The inner exception System.Reflection.ReflectionTypeLoadException was thrown wit
h the following error message: Unable to load one or more of the requested types
. Retrieve the LoaderExceptions property for more information..
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.

这里还需要注意的一件事是,如果我将该 .dll 复制到本地,则可以正常安装。但是我不想在安装之前加载它,所以我想在运行时加载它。

提前致谢。

最佳答案

也许您需要使用另一个版本的 InstallUtil.exe:

  • c:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe
  • c:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe
  • c:\Windows\Microsoft.NET\Framework64\v2.0.50727\InstallUtil.exe
  • c:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe

尝试使用 Framework64 子文件夹中的 x64 版本。

关于c# - Windows 服务 : System. Reflection.ReflectionTypeLoadException 被抛出并出现以下错误消息:无法加载一个或多个重新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19360378/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com