【问题标题】:c# setup application for windowsc#为windows设置应用程序
【发布时间】:2012-12-19 04:25:02
【问题描述】:

我正在开发一个 c# 应用程序,并为此创建了安装文件。 我在 32 位机器上安装了安装文件,安装文件将安装在应用程序 n c\programfiles 文件夹中。但是当我在安装安装文件后运行应用程序时,它会抛出如下错误。

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.

但是当我将此应用程序放在其他驱动器(如 e 驱动器)中时,应用程序运行时没有任何问题。

如果有任何修复,请告诉我。

问候 桑吉塔

【问题讨论】:

  • 尝试调试传递给System.Number.StringToNumber函数的参数,也许将它们写入一个文本文件,您可以向我们展示...

标签: c#


【解决方案1】:

您正在尝试在此方法中将字符串转换为数字:在 TouchStation.Program.writeSettingsToRegistry() - 如果没有该代码,我们将无法提供进一步的帮助。

【讨论】:

  • 看起来是这样,但 OP 告诉我们,如果相同的软件从同一台电脑(驱动器 E)上的不同位置运行,一切正常......听起来很奇怪,但我等待一些其他信息...
  • 问题作者写错了。它可能适用于另一台机器上的某些输入,但例外情况很明显,这与 x86 或 x64 操作系统无关。
  • @Ramhound:好吧,在阅读错误后的瞬间,我认为这可能与语言环境有关(例如十进制分隔符),但 OP 说在同一台电脑上但在不同的位置,everythink 工作。可能他是错的,你是对的,但是没有任何其他信息我们什么都做不了,对吧? ;)
【解决方案2】:

问题出在区域设置中。 例如小数的分隔符是“,”而不是“。”

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-10-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多