2012-11-27 28 views
0

我開發出口在dcmfiles到excel文件變化的工具..錯誤在其他機器,但沒有在我的(指數數組的邊界之外)

我有這個錯誤發生在其他機器,但不是在我的

(指數數組的邊界之外)

這裏是故障描述:

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box. 

************** Exception Text ************** 
System.IndexOutOfRangeException: Index was outside the bounds of the array. 
    at WindowsApplication1.Mdl_GetDifference.compareParsedDCMTotalRepo(DCMStruct[] myDCMs, Worksheet& xlSheetRev, Int32& FileRow, Int32 SvnNo, String FName, String baseline) 
    at WindowsApplication1.ToExcel.GenTotalReport(Worksheet& xlSheetRev, String baseline) 
    at WindowsApplication1.ToExcel.ExportToExcel(String baseline) 
    at WindowsApplication1.Home.GenRop_Click(Object sender, EventArgs e) 
    at System.Windows.Forms.Control.OnClick(EventArgs e) 
    at System.Windows.Forms.Button.OnClick(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.Control.ControlNativeWindow.OnMessage(Message& m) 
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 


************** Loaded Assemblies ************** 
mscorlib 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.3634 (GDR.050727-3600) 
    CodeBase: file:///C:/WINNT/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll 
---------------------------------------- 
AdvertTest 
    Assembly Version: 1.0.0.0 
    Win32 Version: 1.0.0.0 
    CodeBase: file://bosch.com/dfsrb/DfsDE/DIV/BEG/EC/Common/Arbeitshilfen/Tools/Advert/00_temp/BetaTest_Version/AdvertTest.exe 
---------------------------------------- 
Microsoft.VisualBasic 
    Assembly Version: 8.0.0.0 
    Win32 Version: 8.0.50727.3053 (netfxsp.050727-3000) 
    CodeBase: file:///C:/WINNT/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll 
---------------------------------------- 
System 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.3634 (GDR.050727-3600) 
    CodeBase: file:///C:/WINNT/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll 
---------------------------------------- 
System.Windows.Forms 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.3637 (GDR.050727-3600) 
    CodeBase: file:///C:/WINNT/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll 
---------------------------------------- 
System.Drawing 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.3639 (GDR.050727-3600) 
    CodeBase: file:///C:/WINNT/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll 
---------------------------------------- 
System.Configuration 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 
    CodeBase: file:///C:/WINNT/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll 
---------------------------------------- 
System.Xml 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 
    CodeBase: file:///C:/WINNT/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll 
---------------------------------------- 
System.Runtime.Remoting 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 
    CodeBase: file:///C:/WINNT/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll 
---------------------------------------- 
Interop.PushOkSvn 
    Assembly Version: 1.3.0.0 
    Win32 Version: 1.3.0.0 
    CodeBase: file://bosch.com/dfsrb/DfsDE/DIV/BEG/EC/Common/Arbeitshilfen/Tools/Advert/00_temp/BetaTest_Version/Interop.PushOkSvn.DLL 
---------------------------------------- 
Microsoft.Office.Interop.Excel 
    Assembly Version: 12.0.0.0 
    Win32 Version: 12.0.6600.1000 
    CodeBase: file:///C:/WINNT/assembly/GAC/Microsoft.Office.Interop.Excel/12.0.0.0__71e9bce111e9429c/Microsoft.Office.Interop.Excel.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: 

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

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. 

,如果需要,我可以添加更多的信息。請任何幫助將不勝感激

Public Sub compareParsedDCMTotalRepo(ByVal myDCMs() As DCMStruct, ByRef xlSheetRev As Worksheet, ByRef FileRow As Integer, ByVal SvnNo As Integer, ByVal FName As String, ByVal baseline As String) 

    ' is completly the same with function compareparsedDCM but just writing into excel is different, here we added few more coloums to excel 

    Dim myVal1, myVal2, myVal1X, myVal2X, myVal1Y, myVal2Y, index2 As String 
    Dim myName1 As String '= "" 
    Dim k, l, m 
    Dim FileCol As Integer = 1 
    Dim ParameterCol As Integer = 2 
    Dim ParTypeCol As Integer = 3 
    Dim OldValCol As Integer = 4 
    Dim NewValCol As Integer = 5 
    Dim ChgByCol As Integer = 6 
    Dim CommCol As Integer = 7 
    Dim RevCol As Integer = 8 
    Dim GenCommCol As Integer = 12 
    Dim TcmInfoCol As Integer = 13 
    Dim BaselineCol As Integer = 14 

    FName = FName.Substring(FName.LastIndexOf("/") + 1) 

    CommColl.Clear() 

    loadCommColl(SvnData(SvnNo).CommitComment) 


    '''''''''''''''''''''''''''''''''''''''' The following handles with the Festwert part.'''''''''''''''''''''''''''''' 
    ' checking all the festwert values of old file and new file 
    For k = LBound(myDCMs(0).FESTWERT) To UBound(myDCMs(0).FESTWERT) 

     If myDCMs(0).FestwCount < 1 Then 
      Exit For 
     End If 
     myName1 = myDCMs(0).FESTWERT(k).Name 
     myVal1 = myDCMs(0).FESTWERT(k).Value 

     index2 = -1 ' index2 is used to find if name of the Parameter in old DCM also exists in the new one. 
     ' This step checks, whether this Festwert is changed in the new DCM file by looking for its name in the FESTWERTMap. 
     If myDCMs(1).FESTWERTMap.Contains(myName1) Then 
      index2 = myDCMs(1).FESTWERTMap(myName1) 
     End If 

     If index2 < 0 Then 
      ' if index is <0 means its not there that is removed from the file 
      ' so, we are writing the same into excel file 
      xlSheetRev.Cells(FileRow, FileCol) = FName 
      xlSheetRev.Cells(FileRow, ParameterCol) = myName1 
      xlSheetRev.Cells(FileRow, ParTypeCol) = "Festwert" 
      xlSheetRev.Cells(FileRow, OldValCol) = myVal1 
      xlSheetRev.Cells(FileRow, NewValCol) = "Removed" 
      xlSheetRev.Cells(FileRow, ChgByCol) = ParamAuthor.Item(FName & ";" & myName1) 
      xlSheetRev.Cells(FileRow, CommCol) = ParamCommTotal(SvnNo, FName, myName1) 
      If SvnData(SvnNo).RevNo <> 0 Then 
       xlSheetRev.Cells(FileRow, RevCol) = SvnData(SvnNo).RevNo 
      End If 
      xlSheetRev.Cells(FileRow, GenCommCol) = getGenComment() 
      xlSheetRev.Cells(FileRow, TcmInfoCol) = myName1 & ":" & myVal1 & "-->" & "Removed" 
      xlSheetRev.Cells(FileRow, BaselineCol) = baseline 
      FileRow = FileRow + 1 
      findInfoHRevParam(SvnNo, FName, myName1) 
     Else ' if the FW exists, check if it was changed 
      myVal2 = myDCMs(1).FESTWERT(index2).Value ' get the new valua. 
      If diffValue(myVal1, myVal2) Then 
       ' comparing the oldvalues and newvalues, if they are not equal then chaged. Has to be written in Excel. 
       xlSheetRev.Cells(FileRow, FileCol) = FName 
       xlSheetRev.Cells(FileRow, ParameterCol) = myName1 
       xlSheetRev.Cells(FileRow, ParTypeCol) = "Festwert" 
       xlSheetRev.Cells(FileRow, OldValCol) = myVal1 
       xlSheetRev.Cells(FileRow, NewValCol) = myVal2 
       xlSheetRev.Cells(FileRow, ChgByCol) = ParamAuthor.Item(FName & ";" & myName1) 
       xlSheetRev.Cells(FileRow, CommCol) = ParamCommTotal(SvnNo, FName, myName1) 
       If SvnData(SvnNo).RevNo <> 0 Then 
        xlSheetRev.Cells(FileRow, RevCol) = SvnData(SvnNo).RevNo 
       End If 
       xlSheetRev.Cells(FileRow, GenCommCol) = getGenComment() 
       xlSheetRev.Cells(FileRow, TcmInfoCol) = myName1 & ":" & myVal1 & "-->" & myVal2 
       xlSheetRev.Cells(FileRow, BaselineCol) = baseline 
       FileRow = FileRow + 1 
       findInfoHRevParam(SvnNo, FName, myName1) 
      End If 
     End If 
    Next k 

    ' If there is newly added FW. 
    For k = LBound(myDCMs(1).FESTWERT) To UBound(myDCMs(1).FESTWERT) 
     If myDCMs(1).FestwCount < 1 Then 
      Exit For 
     End If 
     myName1 = myDCMs(1).FESTWERT(k).Name 
     If myDCMs(0).FESTWERTMap.Contains(myName1) = False Then 
      xlSheetRev.Cells(FileRow, FileCol) = FName 
      xlSheetRev.Cells(FileRow, ParameterCol) = myName1 
      xlSheetRev.Cells(FileRow, ParTypeCol) = "Festwert" 
      xlSheetRev.Cells(FileRow, OldValCol) = "Added" 
      xlSheetRev.Cells(FileRow, NewValCol) = myDCMs(1).FESTWERT(k).Value 
      xlSheetRev.Cells(FileRow, ChgByCol) = ParamAuthor.Item(FName & ";" & myName1) 
      xlSheetRev.Cells(FileRow, CommCol) = ParamCommTotal(SvnNo, FName, myName1) 
      If SvnData(SvnNo).RevNo <> 0 Then 
       xlSheetRev.Cells(FileRow, RevCol) = SvnData(SvnNo).RevNo 
      End If 
      xlSheetRev.Cells(FileRow, GenCommCol) = getGenComment() 
      xlSheetRev.Cells(FileRow, TcmInfoCol) = myName1 & ":" & "Added-->" & myDCMs(1).FESTWERT(k).Value 
      xlSheetRev.Cells(FileRow, BaselineCol) = baseline 
      FileRow = FileRow + 1 
      findInfoHRevParam(SvnNo, FName, myName1) 
     End If 
    Next 

末次

+0

如果沒有看到一些代碼,我們無法提供比描述更多的信息。 –

+0

事情是,我自己不知道爲什麼它被添加或在代碼中的位置是錯誤我會添加此代碼也許它可以幫助 –

+0

它被添加上面@Karl Nicoll ..你能幫忙請 –

回答

0

確保裝運.pdb文件爲好,因爲它們包含顯示在異常的堆棧跟蹤行號信息。

System.IndexOutOfRangeException:索引超出了數組的範圍。
 在WindowsApplication1.Mdl_GetDifference.compareParsedDCMTotalRepo(DCMStruct [] myDCMs,工作表& xlSheetRev,的Int32 & FileRow,的Int32 SvnNo,字符串FName參數,字符串基線):線20
 在WindowsApplication1.ToExcel.GenTotalReport(工作表& xlSheetRev ,字符串基線):行35
...

(我用的數字只是一個例子)

然後您將知道引發異常的代碼行。

+0

我比較dcm文件..我不明白爲什麼我應該運送pdf文件..我們比較兩個dcm文件,然後提交更改存儲庫,然後我們使用該工具(我開發)導出更改爲excel –

+0

,如果你的意思是我應該出貨dcm文件兩..我應該說,它是運送..因爲在這裏你應該得到一些信息:我們簽出一個存儲庫,其中包含大量的dcm文件,每當我們有一個文件的變化,然後我們提交更改,並在這裏來比較,所以我們提交更改..然後我們使用這個工具導出在這個文件上發生的變化,我們將目標文件分成兩個;一個是已更改的,另一個是更改前的原始碼 –

+0

我的意思是,每個'.exe'或'.dll'都有一個關聯的'.pdb'文件。例如。 :'WindowsApplication1.exe','WindowsApplication1.pdb'。發生異常時,.NET運行庫使用'.pdb'文件中的信息顯示行號。如果找不到'.pdb'文件,它將顯示沒有行號的錯誤消息。您可以在'bin \ debug'和'bin \ release'文件夾中找到這些文件。 –

相關問題