日期:2014-05-17  浏览次数:20929 次

C#写的程序,为啥到其他机器报错呢?
/mscorlib.dll 这个文件,在报错的机器上也有的
.net框架从2.0,也装到4.0了

还是不行

是什么问题导致的 ?


如何打包,能将工程中用到的系统库文件都打进来?

谢谢



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 ReaderDemo.ReaderDemo2334.getIPInfFromIniFile()
   at ReaderDemo.ReaderDemo2334.Form1_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.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.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
------解决方案--------------------
看提示应该是转换类型错误,不符合int的转换
------解决方案--------------------
把你机器上的 mscorlib.dll 这个文件考到目标机器上去试看看,
是不是这个文件的版本不一至引起的
------解决方案--------------------

与X86  64位这样的有关系吗?

------解决方案--------------------
看提示应该是转换类型错误,不符合int的转换 ==>
是不是操作系统不一样,一个64位,一个是32位的,