Click here to Skip to main content

Silverlight / WPF

 
AnswerRe: silverlight PinprotectorPete O'Hanlon30-Sep-12 10:45 
AnswerRe: silverlight PinmemberKenneth Haugland30-Sep-12 23:36 
AnswerRe: silverlight PinmvpAbhinav S3-Oct-12 21:40 
QuestionCheckk For WCF Service Running & Exit PinmemberKevin Marois29-Sep-12 10:51 
I'm trying to check to see if a WCF service is running, and if not, exit. So far I have this:
 
// Attempt to create an instance of the proxy
bool serviceRunning = true;
try
{
    Proxy = new MyAppServiceRef.MyAppServiceClient();
}
catch (Exception e)
{
    serviceRunning = false;
}
// Now check to see if the service is running
try
{
    serviceRunning = !Proxy.ServiceRunning();
}
catch (Exception e)
{
    serviceRunning = false;
}
 
// If the service is not running, then exit the app
if (!serviceRunning)
{
    string message = "The service appears to not be running. Please check the service. " + ApplicationTitle + " will now exit.";
    MessageBox.Show(message, "Service Error", MessageBoxButton.OK, MessageBoxImage.Stop);
    Application.Current.Shutdown();
}
 
1) is this really the way to do this?
 
2) After the call to Application.Current.Shutdown() the app continue to run and I get XAML errors. How to I actually stop the app dead right here?
 
Thanks
If it's not broken, fix it until it is

QuestionSendMessage in C# WPF PinmemberdominioYP28-Sep-12 7:11 
AnswerRe: SendMessage in C# WPF PinprotectorPete O'Hanlon29-Sep-12 11:30 
GeneralRe: SendMessage in C# WPF PinmemberdominioYP29-Sep-12 13:08 
GeneralRe: SendMessage in C# WPF PinprotectorPete O'Hanlon29-Sep-12 21:45 
QuestionNew to .net/ previous programming background Pinmemberljv_az27-Sep-12 9:29 
AnswerRe: New to .net/ previous programming background PinmvpRichard MacCutchan27-Sep-12 10:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.150302.1 | Last Updated 22 Feb 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid