【发布时间】:2013-06-20 22:12:01
【问题描述】:
在开发电脑上使用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.ResolveType(RuntimeModule 模块, Int32 typeToken, Int Ptr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInst Count, ObjectHandleOnStack 类型)在 System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule 模块, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] 遇到 hodInstantiationContext) 在 System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, 类型 [] 通用类型参数,类型 [] 通用方法参数)在 System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttrib uteRecord caRecord、MetadataImport 范围、Assembly& lastAptcaOkAssembly,运行时模块 decoratedModule,MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable、Object[] 属性、IList derivedAttributes、 RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters , Boolean& isVarArg) 在 System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule 装饰模块,Int32 装饰元数据令牌,Int32 pcaCount, RuntimeType 属性FilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecorate dTargetSecurityTransparent)
在 System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly 组装,RuntimeType caType) 在 System.Reflection.RuntimeAssembly.GetCustomAttributes(类型 属性类型,布尔继承)在 System.Configuration.InstallUtil.Main(String[] args)
似乎连InstallUtil都无法启动,所以无法安装服务。
我应该检查什么?
【问题讨论】:
标签: .net windows-services installutil