【发布时间】:2012-12-05 10:13:35
【问题描述】:
我有一个库 AXInterop.WMPLib,它让我发疯。这是我收到的错误。我没有使用任何其他依赖项。
堆栈跟踪:
[FileLoadException: 无法加载文件或程序集“AxInterop.WMPLib” 或其依赖项之一。参数不正确。 (例外 从 HRESULT: 0x80070057 (E_INVALIDARG))]
[FileLoadException: 无法加载文件或程序集 'AxInterop.WMPLib, Version=1.0.0.0,Culture=neutral,PublicKeyToken=null' 或其之一 依赖关系。参数不正确。 (HRESULT 的例外情况: 0x80070057 (E_INVALIDARG))]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName 文件名,字符串 codeBase,证据 assemblySecurity,RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean for Introspection, Boolean 抑制安全检查)+0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName 文件名,字符串 codeBase,证据 assemblySecurity,RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean for Introspection, Boolean 抑制安全检查)+34
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,证据 assemblySecurity,RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean for Introspection, Boolean 抑制安全检查)+152
System.Reflection.RuntimeAssembly.InternalLoad(字符串组装字符串, 证据组装Security、StackCrawlMark& stackMark、IntPtr pPrivHostBinder,布尔用于自省)+77
System.Reflection.RuntimeAssembly.InternalLoad(字符串组装字符串, 证据组装Security, StackCrawlMark& stackMark, Boolean forIntrospection) +16 System.Reflection.Assembly.Load(String 组装字符串)+28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(字符串 assemblyName, Boolean starDirective) +38[ConfigurationErrorsException: 无法加载文件或程序集 'AxInterop.WMPLib,版本=1.0.0.0,文化=中性, PublicKeyToken=null' 或其依赖项之一。参数是 不正确。 (来自 HRESULT 的异常:0x80070057 (E_INVALIDARG))]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(字符串 程序集名称,布尔型 starDirective) +752
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +218 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91 System.Web.Compilation.BuildManager.CallPreStartInitMethods(字符串 preStartInitListPath) +258
System.Web.Compilation.BuildManager.ExecutePreAppStart() +135
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, 异常 appDomainCreationException) +516[HttpException (0x80004005): 无法加载文件或程序集 'AxInterop.WMPLib,版本=1.0.0.0,文化=中性, PublicKeyToken=null' 或其依赖项之一。参数是 不正确。 (来自 HRESULT 的异常:0x80070057 (E_INVALIDARG))]
System.Web.HttpRuntime.FirstRequestInit(HttpContext 上下文) +9850940 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext 上下文) +101 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest WR) +456
【问题讨论】:
-
你如何包含这个?它是一种什么样的参考?您是否确定您有任何其他程序集,您正在使用的程序集需要这些程序集?另外,您能否包括发生此错误的代码?