加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-15 08:48:22 所属栏目:百科 来源:网络整理
导读:刚与VS2010并排安装VS2015 …… 有问题的应用程序是使用VS2010(设置为使用.Net 4.0)(未迁移到VS2015)在我的机器上正常工作,将其放在服务器上并在堆中翻转而构建的…… stdole是问题…… 在错误Windows Logs应用程序有一个例外: Exception information: Exce
刚与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图标的引用并部署到服务器…一切顺利(触摸木头)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读