|
-
May 31st, 2011, 09:22 AM
#1
Thread Starter
Addicted Member
WPF Application.Restart Two Instances / Single Instance App
Hey guys, when I run Application.Restart after running my Update Form, in the Task Manager my executable is running twice. The application seems to close, but it seems to still run in the background.
Also, on a seperate issue, Is there a Simple way to implement my application as a "Single Instance" application, like in Windows Forms?
Thanks
-
May 31st, 2011, 10:08 AM
#2
Re: WPF Application.Restart Two Instances / Single Instance App
Cellus205, we actually have a WPF section that this should probably be in. Don't worry though, I've alerted the mods and if appropriate, they'll move it.
As for your restart issue, that is a bit odd. Have you initiated a secondary background thread prior to restarting?
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
May 31st, 2011, 10:11 AM
#3
Thread Starter
Addicted Member
Re: WPF Application.Restart Two Instances / Single Instance App
Ah ok, thanks I wasn't aware. But no, I'm not running any background threads in this app.
-
May 31st, 2011, 10:18 AM
#4
Re: WPF Application.Restart Two Instances / Single Instance App
 Originally Posted by cellus205
Ah ok, thanks I wasn't aware. But no, I'm not running any background threads in this app.
So, now I'm a bit confused. Can you explain exactly what you're doing and exactly what's involved? Any code examples will help greatly. Please be as specific as you can.
I just tried making a trial WPF app, to test Application.Restart, but that method does not exist in WPF. So, what's going on here? Are you importing windows form's namespaces? Or is it a second app?
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
May 31st, 2011, 10:30 AM
#5
Thread Starter
Addicted Member
Re: WPF Application.Restart Two Instances / Single Instance App
Yep, Im importing Windows Forms, then calling my AutoUpdate class to update the program, and after it completes, it runs the Application.Restart. Here's how Im calling it
Code:
Dim myAutoUpdate As New AutoUpdate
myAutoUpdate.tsForm = Me
If myAutoUpdate.AutoUpdate(CommandLine, RemotePath) = True Then
Forms.Application.Restart()
End If
-
May 31st, 2011, 02:07 PM
#6
Re: WPF Application.Restart Two Instances / Single Instance App
Thread moved from the 'VB.Net' forum to the 'WPF, ..' forum
(thanks for letting us know weirddemon )
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|