2012-10-05 137 views
0

任何人都可以幫助我解決這個錯誤。如何調試呢?我的代碼在我的機器上運行良好。但在我的朋友機器上,它給了這個運行時錯誤。我在我的代碼中使用interop庫來製作ppt。JIT錯誤調試

 
    See the end of this message for details on invoking 
    just-in-time (JIT) debugging instead of this dialog box. 
    ************** Exception Text ************** 
    System.Runtime.InteropServices.COMException (0x800702E4): Retrieving the COM class factory for component with CLSID {91493441-5A91-11CF-8700-00AA0060263B} failed due to the following error: 800702e4 The requested operation requires elevation. (Exception from HRESULT: 0x800702E4). 
     at CTGOV.Form1.Export2PPT(Int32 tempIndex) 
     at CTGOV.Form1.btnDone_Click(Object sender, EventArgs e) 
     at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) 
     at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) 
     at System.Windows.Forms.Control.WndProc(Message& m) 
     at System.Windows.Forms.ButtonBase.WndProc(Message& m) 
     at System.Windows.Forms.Button.WndProc(Message& m) 
     at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 

    ************** Loaded Assemblies ************** 
    mscorlib 
     Assembly Version: 4.0.0.0 
     Win32 Version: 4.0.30319.269 (RTMGDR.030319-2600) 
     CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll 
    ---------------------------------------- 
    CTGOV 
     Assembly Version: 1.0.0.0 
     Win32 Version: 1.0.0.0 
     CodeBase: file:///C:/TrialsVision(trial%20version)/CTGOV.exe 
    ---------------------------------------- 
    System.Windows.Forms 
     Assembly Version: 4.0.0.0 
     Win32 Version: 4.0.30319.278 built by: RTMGDR 
     CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll 
    ---------------------------------------- 
    System.Drawing 
     Assembly Version: 4.0.0.0 
     Win32 Version: 4.0.30319.282 built by: RTMGDR 
     CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll 
    ---------------------------------------- 
    System 
     Assembly Version: 4.0.0.0 
     Win32 Version: 4.0.30319.269 built by: RTMGDR 
     CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll 
    ---------------------------------------- 
    System.Data 
     Assembly Version: 4.0.0.0 
     Win32 Version: 4.0.30319.237 (RTMGDR.030319-2300) 
     CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll 
    ---------------------------------------- 
    System.Core 
     Assembly Version: 4.0.0.0 
     Win32 Version: 4.0.30319.233 built by: RTMGDR 
     CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll 
    ---------------------------------------- 
    System.Xml 
     Assembly Version: 4.0.0.0 
     Win32 Version: 4.0.30319.233 built by: RTMGDR 
     CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll 
    ---------------------------------------- 
    Microsoft.VisualBasic.PowerPacks.Vs 
     Assembly Version: 10.0.0.0 
     Win32 Version: 10.0.30319.1 
     CodeBase: file:///C:/TrialsVision(trial%20version)/Microsoft.VisualBasic.PowerPacks.Vs.DLL 
    ---------------------------------------- 
    System.Numerics 
     Assembly Version: 4.0.0.0 
     Win32 Version: 4.0.30319.1 built by: RTMRel 
     CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll 
    ---------------------------------------- 
    Microsoft.mshtml 
     Assembly Version: 7.0.3300.0 
     Win32 Version: 7.0.3300.0 
     CodeBase: file:///C:/Windows/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll 
    ---------------------------------------- 
    System.Configuration 
     Assembly Version: 4.0.0.0 
     Win32 Version: 4.0.30319.1 (RTMRel.030319-0100) 
     CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll 
    ---------------------------------------- 
    Ionic.Zip 
     Assembly Version: 1.9.1.5 
     Win32 Version: 1.9.1.5 
     CodeBase: file:///C:/TrialsVision(trial%20version)/Ionic.Zip.DLL 
    ---------------------------------------- 
    System.Xml.Linq 
     Assembly Version: 4.0.0.0 
     Win32 Version: 4.0.30319.1 built by: RTMRel 
     CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll 
    ---------------------------------------- 
    Microsoft.Office.Interop.PowerPoint 
     Assembly Version: 14.0.0.0 
     Win32 Version: 14.0.4754.1000 
     CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.Office.Interop.PowerPoint/14.0.0.0__71e9bce111e9429c/Microsoft.Office.Interop.PowerPoint.dll 
    ---------------------------------------- 
    office 
     Assembly Version: 14.0.0.0 
     Win32 Version: 14.0.4760.1000 
     CodeBase: file:///C:/Windows/assembly/GAC_MSIL/office/14.0.0.0__71e9bce111e9429c/office.dll 
    ---------------------------------------- 
    Microsoft.Office.Interop.Graph 
     Assembly Version: 14.0.0.0 
     Win32 Version: 14.0.4756.1000 
     CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.Office.Interop.Graph/14.0.0.0__71e9bce111e9429c/Microsoft.Office.Interop.Graph.dll 
    ---------------------------------------- 
    System.Data.DataSetExtensions 
     Assembly Version: 4.0.0.0 
     Win32 Version: 4.0.30319.1 built by: RTMRel 
     CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.DataSetExtensions/v4.0_4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll 
    ---------------------------------------- 
    ************** JIT Debugging ************** 
    To enable just-in-time (JIT) debugging, the .config file for this 
    application or computer (machine.config) must have the 
    jitDebugging value set in the system.windows.forms section. 
    The application must also be compiled with debugging 
    enabled. 
    For example: 
    
     
    
    When JIT debugging is enabled, any unhandled exception 
    will be sent to the JIT debugger registered on the computer 
    rather than be handled by this dialog box. 
+0

顯示我們你使用的代碼。就目前而言,這不是一個真正的問題。這個問題可能幾乎是任何東西 – Earlz

+0

谷歌的「powerpoint需要提升」的基本命中。 –

+0

這是一些5K行代碼 – bhavneet

回答

2

您正在運行的.net應用程序必須按順序自動簡報以管理員身份運行 - 因此,「請求的操作需要提升」的錯誤。

+0

謝謝!所以你的意思是我必須以管理員身份運行應用程序。我無法做任何事情,所以我的應用程序無論如何都可以運行。作爲條件,你總是需要運行應用程序作爲管理員聽起來不太好。怎麼樣,這可以幫助http://www.rad.pasfu.com/index.php?/archives/8-How-to-create-.NET-application-with-Run-As-Administrator-itself.html ? – bhavneet

0

聽起來像Windows用戶帳戶控制(UAC)需要提升您要執行的代碼的權限。右鍵單擊您的可執行文件並以管理員身份運行,或者禁用UAC。

0

啓用Windows窗體的實時調試。

默認情況下,Windows窗體應用程序有一個頂級異常處理程序,它允許程序在可以恢復的情況下繼續運行。例如,如果您的Windows窗體應用程序引發未處理的異常,你會看到一個對話框,如下所示:

enter image description here

要啓用剛剛在時間的Windows調試窗體應用程序,您必須執行以下額外的步驟:

的jitDebugging值設置爲true在Machine.config或.exe.config文件與的system.windows.form部分:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>