InstallUtil throws TypeLoadException of AssemblySignatureKey



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

  • InstallUtil.exe
  • InstallUtil.exe.config
  • InstallUtilLib.dll

在管理模式下运行util后,我得到以下异常:

未处理的异常:System.TypeLoadException:无法加载类型程序集中的"System.Reflection.AssemblySignatureKeyAttribute"'mscorlib,版本=4.0.0.0,区域性=中性,PublicKeyToken=b77a5c561934e089'。在System.ModuleHandle.RevolveType(RuntimeModule模块,Int32 typeToken,Int Ptr*类型InstArgs,Int32类型InstCount,IntPtr*方法InstArgs,Int32 methodInst Count,ObjectHandleOnStack类型)System.ModuleHandle.RevolveTypeHandleInternal(RuntimeModule模块,Int32 typeToken,RuntimeTypeHandle[]typeInstantiationContext,RuntimeTypeHandle[]在遇到hodInstantiationContext)System.Reflection.RuntimeModule.ResolveType(Int32元数据令牌,键入[]ge nericTypeArguments,键入[]genericMethodArguments)System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord,元数据导入范围,Assembly&lastAptcaOkAssembly,运行时模块decoratedModule,MetadataTokendecoratedToken,RuntimeType属性Filte rType,布尔值mustBeInheritable,Object[]属性,IList derivedAttributes,运行时类型&attributeType,IRuntimeMethodInfo&ctor,布尔&ctorHasParameters,布尔型&isVarArg)System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModuledecora-tedModule,Int32 decoratedMetadataToken,Int32 pcaCount,RuntimeType属性FilterType,布尔值必须BeInheritable,IListderivedAttributes,布尔值为Decorate dTargetSecurityTransparent)
在System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssemblyassembly,RuntimeType caType)System.Reflection.RuntimeAssembly.GetCustomAttributes(类型attributeType,布尔继承)System.Configuration.InstallUtil.Main(String[]args)

似乎连InstallUtil都无法启动,所以它无法安装服务
我应该检查什么?

您可以尝试从C:\Windows\Microsoft.NET\Framework\v4.0.30319\或其他相关文件夹(位于C:\Windows\Microsoft.com/NET内)运行"installutil.exe"吗??

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

相关内容

  • 没有找到相关文章

最新更新