0
votes

i have created C# WinForm on my Windows server 2008 and it works fine.

but when i transfert this MyProg.exe into computer window 7, and i run it, nothing happen.

my code:

[STAThread]
        static void Main()
        {

            try
            {
                Application.SetCompatibleTextRenderingDefault(false);
                DevExpress.UserSkins.BonusSkins.Register();
                Application.EnableVisualStyles();

                //Pour TEST
                //Le_ClientID = "850001";
                //Le_Login = "850001FA";

                using (var loginForm = new Login())
                {
                    if (loginForm.ShowDialog() != System.Windows.Forms.DialogResult.OK)
                        return;
                }

                Application.Run(new Le_MainForm());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

Anybody have an idea ?

event log show: - System

  • Provider

    [ Name] Application Error

  • EventID 1000

    [ Qualifiers] 0

    Level 2

    Task 100

    Keywords 0x80000000000000

  • TimeCreated

    [ SystemTime] 2012-05-14T09:40:39.000000000Z

    EventRecordID 3557

    Channel Application

    Computer anjouachemineme

    Security

    • EventData

    FrontEnd_Offline.exe 1.0.0.0 4fb0c28b KERNELBASE.dll 6.1.7601.17651 4e2111c0 e0434352 0000d36f f84 01cd31b59ee78b7d C:\Soft8_Local\FrontEnd_Offline.exe C:\Windows\system32\KERNELBASE.dll dcb7cb01-9da8-11e1-bf8c-1c6f65c1ad74

Thanks you in advance, Stev

PS: As i lunch MyProg.exe, it listed on Task Manger, but it disapear (killed) in about 3 second after.

2
If you start it under a debugger what shows? - Richard
Have you copied any additional files along with the .exe (.config, .manifest)? - Shai
Are you not getting error messages at all? Nothing in the event logs? - Oded
Maybe you can't run exe ? have you checked the privileges ? - V4Vendetta
Does the other computer have the same version of DevExpress installed? - LarsTech

2 Answers

0
votes

Execute the exe (Start as Administrator)

or

this may happen if you dont have Framework Installed in which you created the application by default windows 7 comes with 2.0 and 3.5 Framework . if you created application in visual studio 2010 then you need to download FrameWork 4.0 from Microsoft website to run that exe in Windows 7

you can download Framework 4.0 from here

0
votes

I just encountered this issue in a Windows form App I created. Apparently there is a plethora of issues that can cause this. In my case you could open the Task Manager, click the application, see it open in the task manager, and immediately close. The only way to see what the issue was, was to look at the event viewer and find the error.

The first is dependencies. Like mentioned above, ensure all required .dlls are included and that you have the required framework(s) installed.

Second KERNELBASE.dll can become corrupted. To ensure that is not the case you can run the System File checker. Instructions can be found here: http://support.microsoft.com/kb/929833

Third, is my case. I had a method running in the constructor of Program.cs which is the first thing instantiated when you start a windows form app. I had a bug in code that was causing an exception before any exception handling was created. To fix the problem I moved the code to a point after I create an unhandled exception method as such:

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

in my forms constructor. Now the program would start and actually throw an error. I then just had to fix the bug in my code.

I hope this can help you or anyone else out there.