在开发计算机上,使用InstallUtil时没有出现错误,服务已成功安装。
我打算在另一台计算机上安装它(安装了.Net 4.0 ),所以我将以下文件复制到目标目录中:
在管理模式下运行util之后,我得到以下异常:
未处理的异常: System.TypeLoadException:未能从程序集'mscorlib、Version=4.0.0.0、Culture=neutral、PublicKeyToken=b77a5c561934e089加载类型的System.TypeLoadException‘。在System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule模块(RuntimeModule模块、Int32 typeToken、Int Ptr* typeInstArgs、Int32 typeInstCount、IntPtr* methodInstArgs、Int32 methodInst计数、ObjectHandleOnStack类型)在System.Reflection.RuntimeModule.ResolveType(Int32 #en2 20#、ge、en25#、范围、程序集和、运行时模块、en2 31#、、Boolean,System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule的Object[]属性,IList derivedAttributes,RuntimeType& attributeType,IRuntimeMethodInfo& ctor,布尔& ctorHasParameters,布尔& isVarArg) 在System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly asse,RuntimeType caType)在System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType,布尔继承)在System.Configuration.InstallUtil.Main(String[] args)
似乎连InstallUtil都无法启动,因此无法安装该服务。
我该查些什么?
发布于 2013-06-27 08:30:26
您可以尝试从C:\Windows\Microsoft.NET\Framework\v4.0.30319\或其他相关文件夹(在C:\Windows\Microsoft.NET中)运行"installutil.exe“吗?
我主要认为,您看到的错误主要是由于.NET版本的不匹配。
https://stackoverflow.com/questions/17274885
复制相似问题