none
función application.restart() dejo de funcionar RRS feed

  • Question

  • Tengo una aplicación de escritorio en la cual utilizo en c# la función application.restart() en dos partes diferentes. Una a través de un botón en la aplicación y otra que se ejecuta a través de una aplicación externa. La primera funciona perfecto siempre pero la segunda dejo de funcionar cuando tuve que desinstalar y volver a instalar la aplicación. Solo pasa en mi maquina después de esto ultimo. En otras pc sigue funcionando bien. No puedo encontrar la solución, en el visor de eventos no muestra nada. alguna idea?
    Wednesday, December 11, 2019 7:09 PM

All replies

  • Hi Jose Luis Nicolas, 

    Thank you for posting here.

    It is probable that some code in external applications on your computer stop the application from automatically shutting down, or starting up.

    You can try the following code.

     System.Diagnostics.Process.Start(Application.ExecutablePath);
     Application.Exit();

    Here are two related references you can refer to.

    1. How do I restart my C# WinForm Application?
    2. Why is Application.Restart() not reliable?

    Hope them could be helpful.

    Besides, as this is an English forum, I suggest you describe your problem in English, which will help others understand your problem.

    Best Regards,

    Xingyu Zhao



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, December 12, 2019 2:11 AM
    Moderator