gpt4 book ai didi

.net - InstallUtil 抛出 AssemblySignatureKeyAttribute 的 TypeLoadException

转载 作者:行者123 更新时间:2023-12-01 13:59:08 27 4
gpt4 key购买 nike

在开发机上使用InstallUtil没有报错,服务安装成功。
我打算在另一台计算机上安装它(它安装了.Net 4.0),所以我将以下文件复制到目标目录:

  • 安装工具.exe
  • InstallUtil.exe.config
  • InstallUtilLib.dll

在管理员模式下运行 util 后,出现以下异常:

Unhandled Exception: System.TypeLoadException: Could not load type 'System.Reflection.AssemblySignatureKeyAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, Int Ptr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInst Count, ObjectHandleOnStack type) at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] met hodInstantiationContext) at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] ge nericTypeArguments, Type[] genericMethodArguments) at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttrib uteRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, Runtime Module decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilte rType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters , Boolean& isVarArg) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decora tedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFi lterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecorate dTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly asse mbly, RuntimeType caType) at System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit) at System.Configuration.InstallUtil.Main(String[] args)

好像连InstallUtil都启动不了,所以无法安装服务。
我应该检查什么?

最佳答案

您能否尝试从 C:\Windows\Microsoft.NET\Framework\v4.0.30319\或其他相关文件夹(在 C:\Windows\Microsoft.NET 中)运行“installutil.exe”??

我主要认为,您看到的错误主要是因为 .NET 版本不匹配。

关于.net - InstallUtil 抛出 AssemblySignatureKeyAttribute 的 TypeLoadException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17274885/

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