简体   繁体   English

无法加载文件或程序集“AxInterop.WMPLib”或其依赖项之一。 参数不正确。

[英]Could not load file or assembly 'AxInterop.WMPLib' or one of its dependencies. The parameter is incorrect.

I have one library AXInterop.WMPLib and it is driving me crazy.我有一个库 AXInterop.WMPLib,它让我发疯。 this is the error that I receive.这是我收到的错误。 I am not using any other dependencies.我没有使用任何其他依赖项。

Stack Trace:堆栈跟踪:

[FileLoadException: Could not load file or assembly 'AxInterop.WMPLib' or one of its dependencies. [FileLoadException: 无法加载文件或程序集“AxInterop.WMPLib”或其依赖项之一。 The parameter is incorrect.参数不正确。 (Exception from HRESULT: 0x80070057 (E_INVALIDARG))] (来自 HRESULT 的异常:0x80070057 (E_INVALIDARG))]

[FileLoadException: Could not load file or assembly 'AxInterop.WMPLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. [FileLoadException:无法加载文件或程序集“AxInterop.WMPLib,版本=1.0.0.0,文化=中性,PublicKeyToken=null”或其依赖项之一。 The parameter is incorrect.参数不正确。 (Exception from HRESULT: 0x80070057 (E_INVALIDARG))] (来自 HRESULT 的异常:0x80070057 (E_INVALIDARG))]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean for Introspection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean for Introspection, Boolean抑制SecurityChecks) +34
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean for Introspection, Boolean SuppressSecurityChecks) +152
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean for Introspection) +77
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +16 System.Reflection.Assembly.Load(String assemblyString) +28 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean for Introspection) +16 System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38

[ConfigurationErrorsException: Could not load file or assembly 'AxInterop.WMPLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. [ConfigurationErrorsException:无法加载文件或程序集“AxInterop.WMPLib,版本=1.0.0.0,文化=中性,PublicKeyToken=null”或其依赖项之一。 The parameter is incorrect.参数不正确。 (Exception from HRESULT: 0x80070057 (E_INVALIDARG))] (来自 HRESULT 的异常:0x80070057 (E_INVALIDARG))]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +752 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +752
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +218 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130 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.GetReferencedAssemblies(CompilationSection compConfig) +170
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +258 System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +258
System.Web.Compilation.BuildManager.ExecutePreAppStart() +135 System.Web.Compilation.BuildManager.ExecutePreAppStart() +135
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516

[HttpException (0x80004005): Could not load file or assembly 'AxInterop.WMPLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. [HttpException (0x80004005): 无法加载文件或程序集“AxInterop.WMPLib,版本=1.0.0.0,Culture=neutral,PublicKeyToken=null”或其依赖项之一。 The parameter is incorrect.参数不正确。 (Exception from HRESULT: 0x80070057 (E_INVALIDARG))] (来自 HRESULT 的异常:0x80070057 (E_INVALIDARG))]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9850940 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +456 System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9850940 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +456

I assume you develop this application on Windows client (XP, Vista, or 7), and then deploy it to a Windows Server (2008, 2008 R2 and so on)我假设您在 Windows 客户端(XP、Vista 或 7)上开发此应用程序,然后将其部署到 Windows Server(2008、2008 R2 等)

Windows Media Player is an optional component on Windows Server (different from Windows client such as Windows 7), so you will have to enable it (as part of Desktop Experience role service), Windows Media Player 是 Windows Server 上的可选组件(不同于 Windows 客户端,例如 Windows 7),因此您必须启用它(作为桌面体验角色服务的一部分),

http://technet.microsoft.com/en-us/library/cc772567.aspx http://technet.microsoft.com/en-us/library/cc772567.aspx

After that AxInterop.WMPLib should be able to locate its dependencies (native libraries in Windows Media Player).之后,AxInterop.WMPLib 应该能够找到其依赖项(Windows Media Player 中的本机库)。

I had the same error in Windows 10 Pro.我在 Windows 10 专业版中遇到了同样的错误。 The problem was that I was using custom Build Events to compile in another path, and I was missing to add the libraries into the project compilation folder.问题是我使用自定义构建事件在另一个路径中进行编译,而我没有将库添加到项目编译文件夹中。

So, be sure to add the AxInterop.WMPLib.dll and Interop.WMPLib.dll into the project folder.因此,请务必将AxInterop.WMPLib.dllInterop.WMPLib.dll添加到项目文件夹中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法加载文件或程序集“ EntityFramework.SqlServer”或其依赖项之一。 参数不正确 - Could not load file or assembly 'EntityFramework.SqlServer' or one of its dependencies. The parameter is incorrect 无法加载文件或程序集“ AjaxControlToolkit”或其依赖项之一。 参数不正确 - Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The parameter is incorrect 无法加载文件或程序集“SharpSvn”或其依赖项之一。 尝试加载格式不正确的程序 - Could not load file or assembly 'SharpSvn' or one of its dependencies. An attempt was made to load a program with an incorrect format 无法加载文件或程序集“ MyLibrary”或其依赖项之一。 试图加载格式错误的程序 - Could not load file or assembly 'MyLibrary' or one of its dependencies. An attempt was made to load a program with an incorrect format 无法加载文件或程序集xxx或其依赖项之一。 试图加载格式错误的程序。 - Could not load file or assembly xxx or one of its dependencies. An attempt was made to load a program with an incorrect format. 无法加载文件或程序集“xxx”或其依赖项之一。 试图加载格式不正确的程序 - Could not load file or assembly 'xxx' or one of its dependencies. An attempt was made to load a program with an incorrect format BadImageFormatException 无法加载文件或程序集或其依赖项之一。 试图加载格式不正确的程序 - BadImageFormatException Could not load file or assembly or one of its dependencies. An attempt was made to load a program with an incorrect format 无法加载文件或程序集“ MWArray”或其依赖项之一。 试图加载格式错误的程序 - Could not load file or assembly 'MWArray' or one of its dependencies. An attempt was made to load a program with an incorrect format 无法加载文件或程序集“...”或其依赖项之一。 试图加载格式不正确的程序 - Could not load file or assembly '...' or one of its dependencies. An attempt was made to load a program with an incorrect format 无法加载文件或程序集“sapnco”或其依赖项之一。 试图加载格式不正确的程序 - Could not load file or assembly 'sapnco' or one of its dependencies. An attempt was made to load a program with an incorrect format
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM