- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在开发机上使用InstallUtil没有报错,服务安装成功。
我打算在另一台计算机上安装它(它安装了.Net 4.0),所以我将以下文件复制到目标目录:
在管理员模式下运行 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/
在开发机上使用InstallUtil没有报错,服务安装成功。 我打算在另一台计算机上安装它(它安装了.Net 4.0),所以我将以下文件复制到目标目录: 安装工具.exe InstallUtil.ex
我是一名优秀的程序员,十分优秀!