首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法加载文件或程序集stdole

无法加载文件或程序集stdole
EN

Stack Overflow用户
提问于 2016-02-18 09:57:59
回答 4查看 17.3K关注 0票数 10

刚把VS2015和VS2010并排安装.

所讨论的应用程序是使用VS2010 (设置为使用.Net 4.0) (而不是迁移到VS2015)构建的,在我的机器上工作得很好,放在服务器上,然后掉进堆中……斯托尔是问题所在..。

在错误Windows日志>应用程序中,有一个异常:

代码语言:javascript
复制
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, 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.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, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at     System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, 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, 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)

查看了对stdole的引用,它是对GAC和版本的引用: 2.0.0.0

什么都没有改变。

这个错误到底是从哪里来的?

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2016-02-18 10:52:41

以防其他人遇到和我一样的问题.

我就是这样解决这个问题的:

删除了对stdole的现有引用,然后添加了一个引用>扩展> stdole的四个条目!一个带有office图标,一个带有VS图标,一个带有cog (安装图标),另一个没有图标(所有四个都是完全相同的版本号等等).

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

票数 6
EN

Stack Overflow用户

发布于 2017-02-13 05:08:05

在您的项目中添加一个引用到'stdole.dll',这可以在几个不同的地方找到

  • 您的GAC (C:\Windows\程序集)
  • C:\程序文件(X86)\公共文件\Microsoft\MSEnv\PublicAssemblies

重建,重新部署,一切都应该是好的。

票数 1
EN

Stack Overflow用户

发布于 2021-05-28 12:25:35

现在有一个Nuget包,它提供stdole.dll

https://www.nuget.org/packages/stdole

所以今天,如果您不想假设它在GAC中,或者如果您需要一个特定的版本,这可能是将它包含到您的项目中的最可靠的方法。有些版本从17.0.0 (预览)一直到7.0.3300,虽然不是连续的。(不确定他们是跳过版本号,还是有些人真的失踪了?)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35478201

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档