c# – 无法加载文件或程序集stole

前端之家收集整理的这篇文章主要介绍了c# – 无法加载文件或程序集stole前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
刚与VS2010并排安装VS2015 ……

有问题的应用程序是使用VS2010(设置为使用.Net 4.0)(未迁移到VS2015)在我的机器上正常工作,将其放在服务器上并在堆中翻转而构建的……
stdole是问题……

错误Windows Logs>应用程序有一个例外:

Exception information: 
Exception type: ConfigurationErrorsException 
Exception message: Could not load file or assembly 'stdole,Version=7.0.3300.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name signature could not be verified.  The assembly may have been tampered with,or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
   at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective)
   at System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
   at System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)
   at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)
   at System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()
   at System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath,Boolean& isRefAssemblyLoaded)
   at System.Web.Compilation.BuildManager.ExecutePreAppStart()
   at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager,IApplicationHost appHost,IConfigMapPathFactory configMapPathFactory,HostingEnvironmentParameters hostingParameters,PolicyLevel policyLevel,Exception appDomainCreationException)

Could not load file or assembly 'stdole,or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName,String codeBase,Evidence assemblySecurity,RuntimeAssembly locationHint,StackCrawlMark& stackMark,IntPtr pPrivHostBinder,Boolean throwOnFileNotFound,Boolean forIntrospection,Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName,Boolean suppressSecurityChecks)
   at     System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,RuntimeAssembly reqAssembly,Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString,Boolean forIntrospection)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString,Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective)

Could not load file or assembly 'stdole' or one of its dependencies. Strong name signature could not be verified.  The assembly may have been tampered with,or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)

Stack trace:    at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Exception appDomainCreationException)

看一下stdole的引用,它是GAC和版本:2.0.0.0

什么都没有改变.

这个错误究竟来自哪里?

解决方法

以防其他人以同样的方式遇到问题……

这就是我解决问题的方法

删除了对stdole的现有引用,然后添加了一个引用>扩展程序> stdole有四个条目!一个带有办公室图标,一个带有VS图标,一个带有齿轮(设置图标),另一个带有图标(所有四个版本号完全相同)…

添加了对VS图标的引用并部署到服务器…一切顺利(触摸木头)

原文链接:https://www.f2er.com/csharp/244933.html

猜你在找的C#相关文章