Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I did installation to my c# app. When I finished installing it.
I started the program then this message came out?
Microsoft .net framework
unhanded exception has occurred in your application .If you click continue,the application will ignore this error and attempt to continue. if you click quit ,the application will close immediately
Index was outside the bounds of the arry.
Posted

1 solution

This means that your application tries to use an array at an index that is outside the bounds of said array. This results in an exception that your application didn't handle.

From what we see here, it's impossible to investigate the cause of the problem. Add a global exception handler[^] to get more information on where the error occured.
 
Share this answer
 
Comments
Member 8584763 23-Nov-12 5:11am    
I tried to put try and catch ,but nothing happends
try
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MDIParent3());
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
Member 8584763 23-Nov-12 5:18am    
I tried this one

[STAThread]

static void Main()

{

//AddGlobalHandlers();

Application.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(false);

//Application.Run(new MainForm());

Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);

AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

Application.Run(new MainForm());

}

static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)

{

MessageBox.Show("CurrentDomain_UnhandledException: " + e.ExceptionObject.ToString());

}

static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)

{

MessageBox.Show("Application_ThreadException: " + e.Exception.Message);

}

and it works

Thanks .
lukeer 23-Nov-12 6:11am    
And by "it works", do you mean that you now know where the error occured and that you were able to fix it? Or do you simply not observe an error message anymore?

In the latter case, this is not a solution. You have to investigate the error and fix it. Otherwise you're asking for doomsday to happen.

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