簡體   English   中英

應用程序在Windows XP下運行,但不在Server 2003 R2下運行

[英]Application runs under windows xp but not under server 2003 r2

我有一個很奇怪的問題。 我剛剛使用Visual Studio 2010和C#中的.net 4開發了一個獨立的應用程序。

我將安裝項目添加到解決方案中,成功構建並編譯了所有內容。

我在調試模式下運行它,后來在我的XP機器上安裝了我的應用程序,一切都進行得很順利,而且效果很好!

現在,我拿了安裝包並將其安裝在運行Server 2003 R2的生產計算機中,但是當我嘗試運行它時,它就啟動了,我可以看到gui幾秒鍾,然后崩潰了。

我使用log4net在我的代碼中添加了許多日志,但是找不到在XP下完美運行的原因,而在Server 2003 R2下完全相同的安裝將不會持續下去。

然后我認為,如果應用程序崩潰,則可能是在系統日志事件查看器下編寫的,確實如此。 我每次運行都會遇到2個錯誤,但我無法真正理解它們的含義。

錯誤附在下面。 任何幫助將不勝感激!

祝一切順利!

================================================== =============================

第一個錯誤:

   Event Type:  Error
Event Source:   .NET Runtime 4.0 Error Reporting
Event Category: None
Event ID:   5000
Date:       8/9/2012
Time:       11:03:26 AM
User:       N/A
Computer:   W2003_ORACLE01
Description:
EventType clr20r3, P1 gpsdispatcherserver.exe, P2 1.0.0.0, P3 502220c3, P4 mscorlib, P5 4.0.0.0, P6 4ba1da6f, P7 210, P8 18, P9 system.argumentoutofrange, P10 NIL.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 63 00 6c 00 72 00 32 00   c.l.r.2.
0008: 30 00 72 00 33 00 2c 00   0.r.3.,.
0010: 20 00 67 00 70 00 73 00    .g.p.s.
0018: 64 00 69 00 73 00 70 00   d.i.s.p.
0020: 61 00 74 00 63 00 68 00   a.t.c.h.
0028: 65 00 72 00 73 00 65 00   e.r.s.e.
0030: 72 00 76 00 65 00 72 00   r.v.e.r.
0038: 2e 00 65 00 78 00 65 00   ..e.x.e.
0040: 2c 00 20 00 31 00 2e 00   ,. .1...
0048: 30 00 2e 00 30 00 2e 00   0...0...
0050: 30 00 2c 00 20 00 35 00   0.,. .5.
0058: 30 00 32 00 32 00 32 00   0.2.2.2.
0060: 30 00 63 00 33 00 2c 00   0.c.3.,.
0068: 20 00 6d 00 73 00 63 00    .m.s.c.
0070: 6f 00 72 00 6c 00 69 00   o.r.l.i.
0078: 62 00 2c 00 20 00 34 00   b.,. .4.
0080: 2e 00 30 00 2e 00 30 00   ..0...0.
0088: 2e 00 30 00 2c 00 20 00   ..0.,. .
0090: 34 00 62 00 61 00 31 00   4.b.a.1.
0098: 64 00 61 00 36 00 66 00   d.a.6.f.
00a0: 2c 00 20 00 32 00 31 00   ,. .2.1.
00a8: 30 00 2c 00 20 00 31 00   0.,. .1.
00b0: 38 00 2c 00 20 00 73 00   8.,. .s.
00b8: 79 00 73 00 74 00 65 00   y.s.t.e.
00c0: 6d 00 2e 00 61 00 72 00   m...a.r.
00c8: 67 00 75 00 6d 00 65 00   g.u.m.e.
00d0: 6e 00 74 00 6f 00 75 00   n.t.o.u.
00d8: 74 00 6f 00 66 00 72 00   t.o.f.r.
00e0: 61 00 6e 00 67 00 65 00   a.n.g.e.
00e8: 20 00 4e 00 49 00 4c 00    .N.I.L.
00f0: 0d 00 0a 00               ....   

================================================== =============================

第二次錯誤:

Event Type: Error
Event Source:   .NET Runtime
Event Category: None
Event ID:   1026
Date:       8/9/2012
Time:       11:03:37 AM
User:       N/A
Computer:   W2003_ORACLE01
Description:
Application: GPSDispatcherServer.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentOutOfRangeException
Stack:
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].get_Item(Int32)
   at GPSDispatcherServer.GPSDispatcherServerManager.createGpsDispInstance()
   at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()


For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

================================================== =============================

你有一個堆棧跟蹤,該死! 如此一來,任何在本機代碼中進行調試崩潰的人都可以夢想得到的。 用它。 崩潰點的代碼在做什么?

看起來像在GPSDispatcherServer.GPSDispatcherServerManager.createGpsDispInstance()方法中,您的程序訪問索引范圍超出范圍的某些對象[1]的列表( System.Collections.Generic.List )。 檢查此方法和從中調用的方法中的所有some_list[index]

我的猜測是某些對象的創建失敗,錯誤被您的代碼忽略。 然后,您的代碼假定該對象已創建並添加到列表中。

故障可能有多種原因:服務器上缺少某些組件,權限不足,資源不足,路徑無效...

[1]無法確定列表中只有釋放版本而沒有符號的類。 當編譯器生成通用代碼時,System .__ Canon是通用參數的標准占位符類。

首先,請確保使用調試符號來構建應用程序(在項目“構建設置”中)。

然后在生產服務器上使用DebugDiag捕獲故障轉儲。 還有其他捕獲故障轉儲的方法,但是我發現這是最簡單的方法之一,並且安裝量很小。

可以使用DebugDiag或WinDbg脫機分析故障轉儲。 最簡單的方法是將故障轉儲文件從服務器上的DebugDiag Logs目錄復制到構建應用程序的bin \\ Release文件夾中。 如果使用WinDbg,則應加載與服務器上安裝的.Net框架匹配的sos.dll擴展名(例如,在C:\\ WINDOWS \\ Microsoft.NET \\ Framework \\ v4.0.30319中)。 因此,也將sos.dll復制到您的構建計算機,並使用將其加載到WinDbg

.load <full path to sos.dll>

然后在WinDbg中打開故障轉儲文件。 WinDbg應該能夠自動找到應用程序符號(pdb),因為它們應該與故障轉儲位於同一目錄中(例如bin \\ Release),並且Windbg應該從pdb中自動找到源代碼。 因此,當您打開故障轉儲時,它應該帶您到引起它的代碼行。 如果不是,請嘗試按F5。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM