2011-01-12 278 views
1

...以及如何解決它?什麼導致'System.Management.MTAHelper'的類型初始值設定項引發異常

這是從64位Windows上運行的32位.Net應用程序拋出的。

機器安裝了需要的.Net框架。

Mozilla/4.0(compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .Net CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)

編輯: 這裏的內部異常

Exception Source: System.Management

Exception Type: System.Runtime.InteropServices.COMException

Exception Message: Retrieving the COM class factory for component with CLSID {A8F03BE3-EDB7-4972-821F-AF6F8EA34884} failed due to the following error: 80040154.

Exception Target Site: .cctor

回答

1

有一個MSDN post,報告了同樣的問題,一個解決方案:

So I went to HKCR\CLSID{A8F03BE3-EDB7-4972-821F-AF6F8EA34884}\InprocServer32(Default) in my x64 environment, and saw the following path: C:\Windows\system32\mscoree.dll.

Customer changed the C:\WINDOWS\SysWOW64\mscoree.dll path he found in there to the right one, and he didn't get the error again.

有沒有爲什麼,路徑可能是錯誤的給予解釋,但似乎它的工作......你至少可以檢查註冊表設置並查看它在相關框中是否顯示錯誤。

+0

哈!發佈此問題後,我在Google上找到了相同的帖子。我會嘗試的。謝謝! – sjlewis 2011-01-12 08:17:16

0

很難沒有進一步的細節說,但是當你得到一個TypeInitializationException,檢查InnerException,它通常包含的根本原因。

+0

內部異常加入到質疑。 – sjlewis 2011-01-12 08:01:00

1

我剛解決了它! 我不得不重新安裝在Windows 7 .NET 1.1方法如下:

下載:http://www.microsoft.com/Downloads/details.aspx?FamilyId=262D25E3-F589-4842-8157-034D1E7CF3A3&displaylang=en 下載:http://www.microsoft.com/downloads/details.aspx?FamilyID=a8f5654f-088e-40b2-bbdb-a83353618b38&displaylang=en

然後:

mkdir c:\dotnetfx 
c:\DotNet 
dotnetfx.exe /T:c:\dotnetfx /C 
c:\dotnetfx\msiexec.exe /a netfx.msi TARGETDIR=C:\DotNet 
NDP1.1sp1-KB867460-X86.exe /Xp:C:\DotNet\netfxsp.msp 
msiexec.exe /a c:\DotNet\netfx.msi /p c:\DotNet\netfxsp.msp 
C:\DotNet\netfx.msi 
相關問題