Hello I’ve created a WinForms application that I’m ready to implement on other computers (outside of mine). I’ve having problems running it elsewhere.
In the Program.cs file I’ve got this to see what the problem is:
static void Main()
{
try
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new mainForm());
}
catch(SystemException ex)
{
MessageBox.Show("Error: ", ex.ToString());
}
}
Nothing it edited here besides the addition of the try/catch. I know the problem is in this Program.cs because I’ve got a series of message boxes are set to show in different stages of the MainForm_Load() block. The application reaches none of them.
This probably sounds really vague, but I simply cannot get this application to work anywhere other than my laptop. Would it be one of the Usings I’ve got? I can include those if needed.
Edit 2: As per Marko’s suggestion, I copied all the external DLLs in the same root folder as the EXE I’m trying to run. The 3rd try-catch block is throwing the exception from the Program.cs which is Application.Run(new mainForm()); and I traced this to the 32nd line of my mainForm.cs. On this line I have my background worker:
private BackgroundWorker snBW = new BackgroundWorker();
are we any closer?
Great and cool question.
Sometimes application fail because of missing, corrupted or turned off target framework version. You can see what framework your application requires, full or client profile and install it before usage.
Problem with corrupted framework often happens to .Net 2.0 because of broken Microsoft update for that component. It happens on different machines from time to time. Solution is to reinstall framework.
Issue with deactivated .Net 3.5 feature happens on Windows 7, 2008 Server sometimes. It can be activated in Features of Windows.
Many .Net 3.5 applications actually requires .Net 3.5SP1.