2012-08-09 34 views
0

我有一個很奇怪的問題。我剛剛在c#中使用visual studio 2010和.net 4開發了一個獨立的應用程序。應用程序在Windows XP下運行,但不在服務器2003下運行r2

我添加了安裝項目到解決方案,構建和編譯所有成功。

我跑了它在調試模式下,後來我安裝我的應用我的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. 

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

+0

請多給點信息:我假設你確定.net 4.0安裝在服務器上。你的程序是否有任何特殊的庫或外部依賴項?你有沒有嘗試在XP兼容模式下運行應用程序? – tgolisch 2012-08-09 14:08:38

+0

我做了一個事件類型的快速谷歌,並遇到此網址,我不知道你是否嘗試過任何這個,但它可能派上用場。 http://social.msdn.microsoft.com/forums/en-US/winformssetup/thread/53c2de93-ab33-41d0-b5dd-7ca5fbfa5c24/ – Qpirate 2012-08-09 14:14:36

回答

0

首先,確保你建立與調試符號您的應用程序(在項目構建設置)。

然後使用DebugDiag在生產服務器上捕獲崩潰轉儲。還有其他捕獲崩潰轉儲的方法,但我發現這是最簡單的一種,而且它是一個小安裝。

崩潰轉儲可以離線或者使用DebugDiag資料或WinDbg進行分析。最簡單的方法是將崩潰轉儲文件從服務器上的DebugDiag Logs目錄複製到您構建應用程序的bin \ Release文件夾中。如果使用WinDbg,則應加載與服務器上安裝的.Net框架匹配的sos.dll擴展(例如,在C:\ WINDOWS \ Microsoft.NET \ Framework \ v4.0.30319中)。所以複製sos.dll到您的構建機器也使用

.load <full path to sos.dll> 

然後打開WinDbg中崩潰轉儲文件將其加載到WinDbg的。 WinDbg應該能夠自動找到應用程序符號(pdb),因爲它們應該與崩潰轉儲位於同一目錄(例如,bin \ Release),並且從pdb WinDbg應自動查找源代碼。所以,當你打開崩潰轉儲時,它應該帶你到導致它的代碼行。如果沒有,請嘗試點擊F5。

1

你有一個堆棧跟蹤,該死的!那更是那些在本地代碼中調試崩潰的人可能會夢寐以求的。用它。崩潰點的代碼在做什麼?

看起來像GPSDispatcherServer.GPSDispatcherServerManager.createGpsDispInstance()方法您的程序訪問索引超出範圍的某些對象[1]的列表(System.Collections.Generic.List)。檢查你所有的some_list[index]這個方法和方法。

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

失敗可能有多種原因:在服務器上缺少一些組件,缺少權限,資源匱乏,無效路徑...

[1]這是不可能的,告訴在僅具有列表什麼課發佈沒有符號的版本。 System .__ Canon是編譯器生成通用代碼時的通用參數的標準佔位符類。

相關問題