1

Closed

FaultException: Invalid application session ID

description

There is a problem when debugging step by step.
 
I have a simple button onclick method
    private void Button_Click(object sender, RoutedEventArgs e)
    {
        var ee = sender as Button;
        var r = new Random();
        if (ee != null)
            ee.Foreground= new SolidColorBrush(Color.FromArgb((byte)r.Next(255), (byte)r.Next(255), (byte)r.Next(255), (byte)r.Next(255)));
 
    }
 
  1. I set breakpoint on "var ee = sender as Button;"
  2. When I stop on this breakpoint and wait some time, phone is disconnected from WP7Explorer.
  3. Now I press F5, and see about three times this exception (I press "OK", next F5, and I see it again):
     
    System.ServiceModel.FaultException1 was unhandled
    Message=Invalid application session ID
    Action=http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher/fault
    StackTrace:
    at System.ServiceModel.DiagnosticUtility.ExceptionUtility.BuildMessage(Exception x)
    at System.ServiceModel.DiagnosticUtility.ExceptionUtility.LogException(Exception x)
    at System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperWarning(Exception e)
    at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
    at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
    at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
    at System.ServiceModel.ClientBase
    1.ChannelBase1.EndInvoke(String methodName, Object[] args, IAsyncResult result)
    at IsolatedStorageExplorer.ApplicationOperationsService.ApplicationOperationsServiceClient.ApplicationOperationsServiceClientChannel.EndGetNextOperation(IAsyncResult result)
    at IsolatedStorageExplorer.ApplicationOperationsService.ApplicationOperationsServiceClient.IsolatedStorageExplorer.ApplicationOperationsService.IApplicationOperationsService.EndGetNextOperation(IAsyncResult result)
    at IsolatedStorageExplorer.ApplicationOperationsService.ApplicationOperationsServiceClient.OnEndGetNextOperation(IAsyncResult result)
    at System.ServiceModel.ClientBase
    1.OnAsyncCallCompleted(IAsyncResult result)
    at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)
    at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously, Exception exception)
    at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.CallComplete(Boolean completedSynchronously, Exception exception)
    at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.FinishSend(IAsyncResult result, Boolean completedSynchronously)
    at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.SendCallback(IAsyncResult result)
    at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)
    at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously, Exception exception)
    at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.OnGetResponse(IAsyncResult result)
    at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClassa.<InvokeGetResponseCallback>b__8(Object state2)
    at System.Threading.ThreadPool.WorkItem.doWork(Object o)
    at System.Threading.Timer.ring()
     
     
    I've attached this sample project.

file attachments

Closed Mar 18, 2011 at 8:25 PM by winromulus

comments

winromulus wrote Mar 17, 2011 at 12:08 PM

This is a known issue with debugging applications. The reason is that the breakpoint will stop the worker thread for the wp7explorer.
In the RC version the explorer will resume the connection but right now you will have to restart your application.


Romeo

PedroNet wrote Aug 23, 2011 at 2:35 PM

Thanks Romeo, I had a same error .

;)