473,614 Members | 2,089 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Restarting an application ...

Could anybody help me to write proper
code to restart my application?

public static void OnRestartReques t()
{
...
}

Restart is needed after exception handled and
may occur anytime in application life time ...
Nov 16 '05 #1
2 3851
Jacek,

In this case, you would probably need another application monitoring the
original application. Of course, you run into the problem of what happens
if the application monitoring the application that originally was running
breaks down.

All in all, you should probably not do this, and let the user restart
the app, logging all information necessary to track down the issue at a
later date.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Jacek Jurkowski" <jj********@dat acomp.szczecin. pl> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Could anybody help me to write proper
code to restart my application?

public static void OnRestartReques t()
{
...
}

Restart is needed after exception handled and
may occur anytime in application life time ...

Nov 16 '05 #2


Alternatively you could write an application that starts up and only runs
the original application...

So you call in your orginal app:

// in the Main Form
public static void OnRestartReques t()
{
Process.Start ( "Restarter. exe" );
Close(); // or Application.Exi t() ??
}
Then have the Restarter app simply call your original app, wait a few secs
maybe, before it closes...

public static void Main()
{
System.Threadin g.Thread.Sleep ( 3000 ); // time for old app to shut
down
Process.Start ("FirstApp.e xe" );
}
Not very neat though... You should probably look at the reasons your wanting
to restart the application in the first place.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:ur******** ******@tk2msftn gp13.phx.gbl...
Jacek,

In this case, you would probably need another application monitoring
the original application. Of course, you run into the problem of what
happens if the application monitoring the application that originally was
running breaks down.

All in all, you should probably not do this, and let the user restart
the app, logging all information necessary to track down the issue at a
later date.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Jacek Jurkowski" <jj********@dat acomp.szczecin. pl> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Could anybody help me to write proper
code to restart my application?

public static void OnRestartReques t()
{
...
}

Restart is needed after exception handled and
may occur anytime in application life time ...


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1589
by: serge | last post by:
We have an ASP application installed on one powerful Win 2003 and the SQL Server on another Win 2003. We have two copies of the application (identical, one for production and one for test purposes) that are operational. The 2nd application is connected to the same SQL Server but a test copy of the production database. Today, running the application, a place where it shows a list of records, the ASP application was timing out after 30...
2
1173
by: davidw | last post by:
How could I figure out what causes that? Thanks!
0
2157
by: LJ | last post by:
I have been getting this message and can't resolve the problem. I have checked the AntiVirus software and added the application directory to the exculsion list. The application is on a web farm, using SANS for file storage. It seemed to start once we installed the SSL cert. But, that could be just when we noticed the problem. Any ideas would be greatly appreciated. Thanks <!ljr!>
3
1898
by: Jerry Boone | last post by:
I have a development unit running XP Pro and I cannot get it to build a web project without restarting IIS. There errors in the task list are.... ! Could not copy temporary files to the output directory ! The file'bin\project1.dll' cannot be copied to the run directory. The process cannot access the file because it is being used by another process. ! The file'bin\project1.pdb' cannot be copied to the run directory. The process...
4
1970
by: Hari Koduru | last post by:
Hi All, I am getting the following exception in an ASP.NET application. Exception Details: System.InvalidOperationException: Application is restarting. I have been to the following Support page
1
1436
by: Scott Lezberg | last post by:
We have an web application and the ASP .NET service keeps restarting for no apparent reason. I understand the recyclying concept and I see the event logged but is there any way to determine what the root cause of ASP .NET restarting was. Thanks in advance. Scott
7
26723
by: GTi | last post by:
Does anyone have any good code for a self restarting application? Sometimes I need to exit my application and start it again, what is the best method of doing this in a windows form application. The reason why I want to this is complicated, so a restart is faster and more easier whey of doing it.
9
3339
by: woolley.dean | last post by:
The problem we are having is with the worker process restarting after one minute of being started up. We had a website running in .Net 1.1 and switched it over to .Net 2.0. The site is running on a W2003 machine w/ IIS6 with 4GB Ram. We have it running in it's own Application Pool with no other websites. The settings we have are: - Recycle worker process after 1440 Minutes - Shut down worker proecess after being idle for 20 minutes
9
1938
by: walterbyrd | last post by:
I think I have read somewhere that using Python to develop web-applications requires some restarting of the Apache server, whereas PHP does not. Also, I seem to remember reading something about PHP being able to recover from Apache restarting more easily than Python. I am not trying to suggest anything here. I'm just asking.
7
1267
by: John | last post by:
Hi Is there a way to restart a winform app in case of a serious error? Thanks Regards
0
8130
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8627
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8579
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8279
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7093
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6088
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4052
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4127
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.