2011-10-25 84 views
0

我正在開發一個c#應用程序,併爲此創建了安裝文件。 我在32位機器上安裝了安裝文件,安裝文件將安裝在應用程序n \ programfiles文件夾中。但是當我安裝安裝文件後運行應用程序時,它會引發如下錯誤。c#windows設置應用程序

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

************** Exception Text ************** 
System.FormatException: Input string was not in a correct format. 
    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) 
    at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) 
    at System.Convert.ToInt32(String value) 
    at TouchStation.Program.writeSettingsToRegistry() 
    at TouchStation.Program.Initialize() 
    at TouchStation.MainForm.statusUpdateTimer_Tick(Object sender, EventArgs e) 
    at System.Windows.Forms.Timer.OnTick(EventArgs e) 
    at System.Windows.Forms.Timer.TimerNativeWindow.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.3625 (GDR.050727-3600) 
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll 
---------------------------------------- 
TouchStation 
    Assembly Version: 2.0.0.1 
    Win32 Version: 2.0.0.1 
    CodeBase: file:///C:/TouchStation2.0.0.1/TouchStation.exe 
---------------------------------------- 
TouchCommonLib 
    Assembly Version: 1.0.0.0 
    Win32 Version: 1.0.0.0 
    CodeBase: file:///C:/TouchStation2.0.0.1/TouchCommonLib.DLL 
---------------------------------------- 
System 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.3624 (GDR.050727-3600) 
    CodeBase: file:///C:/WINDOWS/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.3623 (GDR.050727-3600) 
    CodeBase: file:///C:/WINDOWS/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.3053 (netfxsp.050727-3000) 
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll 
---------------------------------------- 
TouchServerLib 
    Assembly Version: 0.9.2.0 
    Win32 Version: 0.9.2.0 
    CodeBase: file:///C:/TouchStation2.0.0.1/TouchServerLib.DLL 
---------------------------------------- 
System.Configuration 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 
    CodeBase: file:///C:/WINDOWS/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.3082 (QFE.050727-3000) 
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll 
---------------------------------------- 
WindowsHookLib 
    Assembly Version: 1.1.1.0 
    Win32 Version: 1.0.0.4 
    CodeBase: file:///C:/TouchStation2.0.0.1/WindowsHookLib.DLL 
---------------------------------------- 
Accessibility 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll 
---------------------------------------- 
ThingzDB 
    Assembly Version: 1.3.1.0 
    Win32 Version: 1.3.1.0 
    CodeBase: file:///C:/TouchStation2.0.0.1/ThingzDB.DLL 
---------------------------------------- 
System.Data.SQLite 
    Assembly Version: 1.0.65.0 
    Win32 Version: 1.0.65.0 
    CodeBase: file:///C:/TouchStation2.0.0.1/System.Data.SQLite.DLL 
---------------------------------------- 
System.Data 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll 
---------------------------------------- 
System.Transactions 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll 
---------------------------------------- 
HttpServer.MVC 
    Assembly Version: 1.0.0.0 
    Win32 Version: 1.0.0.0 
    CodeBase: file:///C:/TouchStation2.0.0.1/HttpServer.MVC.DLL 
---------------------------------------- 
HttpServer 
    Assembly Version: 1.0.0.0 
    Win32 Version: 1.0.0.0 
    CodeBase: file:///C:/TouchStation2.0.0.1/HttpServer.DLL 
---------------------------------------- 
System.EnterpriseServices 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.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. 

但是,當我把這個應用程序放在其他驅動器如電子驅動器,然後應用程序運行沒有任何問題。

請讓我知道是否有任何修復。

問候 桑吉塔

+0

嘗試調試傳遞給'System.Number.StringToNumber'函數的參數,也許將它們寫入文本文件,您可以向我們展示... – Marco

回答

0

您正在嘗試將字符串轉換爲數字在此方法:在TouchStation.Program.writeSettingsToRegistry() - 無需代碼,我們不能真正有助於進一步不過。

+0

看起來像這樣,但OP告訴我們,如果同一個軟件是從同一臺計算機上的不同位置運行(驅動器E)一切正常......這聽起來很奇怪,但我正在等待其他一些信息... – Marco

+0

問題的作者是錯誤的。它可能適用於另一臺機器上的某些輸入,但異常很明顯,這與x86或x64操作系統無關。 –

+0

@Rhhound:好了,讀完這個錯誤後我立即想到它可能是locale(例如小數點分隔符),但是OP說在同一臺PC上,但是每個方面都有不同的位置。也許他錯了,你說得對,但沒有任何其他信息,我們無能爲力,對吧? ;) – Marco

0

問題在於區域設置。 例如,分隔符的分隔符是「,」而不是「。」。