Click here to Skip to main content
15,868,419 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
***********************************************************************************
I Had Created A Window Application, Finish Debug And It Work Perfectly In My Computer. I Then Copy A Whole Folder Includes The .Exe File To Another Computer Which Doesn't Installed C#. When I Run...
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Exception: input string was not in correct format.
at Microsoft.VisualC#.Interaction.Conver.ToInt32
at Registration.Form1.Button1_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.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
Win32 Version: 4.0.30319.1022 (RTMGDR.030319-1000)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Registration1
Win32 Version: 1.0.0.0
CodeBase: file:///J:/Registration1.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 10.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1001 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1002 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1001 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.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">

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.
********
Posted
Updated 20-Jul-14 21:48pm
v2
Comments
teja sai ravi 21-Jul-14 3:46am    
please help me thank u,
Kornfeld Eliyahu Peter 21-Jul-14 3:49am    
You code fails on Convert.ToInt32() method with message 'input string was not in correct format.'. So the input was not a string can be converted to int... Check the input string!
OriginalGriff 21-Jul-14 3:51am    
We would need to see the code for your Registration.Form1.Button1_Click method.
teja sai ravi 21-Jul-14 5:27am    
the same code is working in my system and in my button click event i am trying read a text file and processing it its working successfully in my system the same text file is not proceesing and giving the above error in another system thanks for ur replys friends
[no name] 21-Jul-14 7:43am    
And? You have already asked this and have been told what the problem is. Go to your button click handler and change the Parse to use a TryParse function instead. Try doing a little bit of debugging.

Quote:
System.Exception: input string was not in correct format.
at Microsoft.VisualC#.Interaction.Conver.ToInt32
at Registration.Form1.Button1_Click(Object sender, EventArgs e)
Why don't you read that message?
Somewhere in the method body of Button1_Click, you try to get a numeric value from some other type of data, likely a string. And that conversion fails.
Why can it fail? Because of non-numeric characters somewhere in the string.
If it works on a different computer with the same value, then because of commas (,) or dots (.) at positions where they should not be according to the selected locale.
 
Share this answer
 
at Microsoft.VisualC#.Interaction.Conver.ToInt32

Your program may be "working perfectly" on your computer, but it is not able to handle an error in the input data. You are making the assumption that the input value is a valid number, rather than checking it first with ParseInt to be sure. I would suggest you go through all your code and add some proper error checks.
 
Share this answer
 
u can use the third party software to make .exe for other system like(Innosetup compiler)
 
Share this answer
 
Comments
[no name] 21-Jul-14 11:52am    
And how would you think that creating a setup program would cure an "input string was not in correct format" exception?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900