我剛剛開發出使用system.manament類的應用程序,但我的朋友正在使用的應用程序,因爲它提供的錯誤有問題。他已經安裝了winxp sp3和.Net framework 2.0,就像我一樣。錯誤運行的應用程序依賴於WMI
System.TypeInitializationException: The type initializer for
'System.Management.MTAHelper' threw an exception. ---> System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {A8F03BE3-EDB7-4972-821F-AF6F8EA34884} failed due to the following error: 80040154. at System.Management.MTAHelper..cctor()
我該如何部署此應用程序確保wmi存在? 可能是什麼問題?
請注意,我引用'system.management.dll',在我的應用程序導入'system.management'。我必須部署和註冊這個DLL與我的應用程序? – Smith
您無法部署和註冊這些DLL。它們是.NET框架的一部分,因此您必須完整地安裝適當版本的框架。 (他們可能取決於將不匹配或者,等等等等其他DLL) –