2012-12-18 110 views
1

我有一個庫AXInterop.WMPLib,它讓我瘋狂。這是我收到的錯誤。我沒有使用任何其他依賴項。無法加載文件或程序集「AxInterop.WMPLib」或其某個依賴項。該參數不正確。

堆棧跟蹤:

[FileLoadException:未能加載文件或程序集AxInterop.WMPLib' 或它的一個依賴。該參數不正確。 (異常 從HRESULT:80070057(E_INVALIDARG))]

[FileLoadException:未能加載文件或程序集AxInterop.WMPLib, 版本= 1.0.0.0,文化=中性公鑰=空「或它 之一依賴。該參數不正確。 (從HRESULT異常: 80070057(E_INVALIDARG))]
System.Reflection.RuntimeAssembly._nLoad(的AssemblyName文件名,字符串 的代碼庫,證據assemblySecurity,RuntimeAssembly locationHint, StackCrawlMark & stackMark,IntPtr的pPrivHostBinder,布爾 throwOnFileNotFound,布爾forIntrospection,布爾 suppressSecurityChecks)0
System.Reflection.RuntimeAssembly.nLoad(的AssemblyName文件名,字符串 的代碼庫,證據assemblySecurity,RuntimeAssembly locationHint, StackCrawlMark & stackMark,IntPtr的pPrivHostBinder,布爾 throwOnFileNotFound,布爾˚F orIntrospection,布爾 suppressSecurityChecks)34
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(的AssemblyName assemblyRef,證據assemblySecurity,RuntimeAssembly reqAssembly, StackCrawlMark & stackMark,IntPtr的pPrivHostBinder,布爾 throwOnFileNotFound,布爾forIntrospection,布爾 suppressSecurityChecks)152
System.Reflection.RuntimeAssembly.InternalLoad(字符串assemblyString, 證據assemblySecurity,StackCrawlMark & stackMark,IntPtr的 pPrivHostBinder,布爾forIntrospection)77
System.Reflect ion.RuntimeAssembly.InternalLoad(字符串assemblyString, 證據assemblySecurity,StackCrawlMark & stackMark,布爾 forIntrospection)16 System.Reflection.Assembly.Load(字符串 assemblyString)28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(字符串 的AssemblyName,布爾starDirective)38

[ConfigurationErrorsException:未能加載文件或組件 'AxInterop.WMPLib,版本= 1.0.0.0,文化=中性 公鑰=空' 或它的一個依賴。該參數是 不正確。 (從HRESULT異常:80070057(E_INVALIDARG))]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(字符串 的AssemblyName,布爾starDirective)752
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() 218系統。 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,Version = 1.0.0.0,Culture = neutral, PublicKeyToken = null'或其依賴項之一。該參數是 不正確。 (從HRESULT異常:80070057(E_INVALIDARG))]
System.Web.HttpRuntime.FirstRequestInit(HttpContext的上下文)9850940 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext的上下文) 101 System.Web.HttpRuntime.ProcessRequestInternal(的HttpWorkerRequest WR) + 456

+0

你好嗎?它是什麼樣的參考?你確定你有任何其他的組件,你正在使用的組件?另外,您是否可以在出現此錯誤的位置包含代碼? – Kjartan

回答

4

我假設你開發Windows客戶端上此應用程序(XP,Vista或7),然後將其部署到Windows Server(2008年,2008 R2等)

Windows Media Player是Windows Server上的一個可選組件(與Windows客戶端不同,如Windows 7),因此您必須e nable它(如桌面體驗角色服務的一部分),

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

之後AxInterop.WMPLib應該能夠找到(在Windows Media Player的本地庫)的依賴。

+0

它的解決 謝謝你所有你 –

相關問題