Solution for “FrameworkDispatcher.Update has not been called exception” in WP XNA

While working with the XNA Framework in Windows Phone 7 application, you might face an exception which says “Invalid Operation Exception” with a message “FrameworkDispatcher.Update has not been called”.


This exception generally occurs when you are working with the sound effects. In this post, we will discuss about this exception and the solution to fix it.


Problem Statement

While working with the sound effects of XNA Framework in Windows Phone application, you might get an “Invalid Operation Exception” if you didn’t update the Framework Dispatcher properly. Here is the screenshot of the said exception:


InvalidOperationException from FrameworkDispatcher.Update


The exception details clearly says that the FrameWorkDispatcher.Update() was not called. Here is the exception message for you:


FrameworkDispatcher.Update has not been called. Regular FrameworkDispatcher.Update calls are necessary for fire and forget sound effects and framework events to function correctly.


The FrameworkDispatcher.Update() method called by the framework automatically if the application implements the “Game” class. The Game.Update() method automatically processes the said method by triggering the event processing in the XNA framework.


If you don’t use the “Game” class in an application which uses the XNA Framework, you must have to call the method FrameworkDispatcher.Update() explicitly, otherwise you will get the above exception in your application.



Event based systems place messages in a message queue and keep it for dispatching. XNA framework messages also follows it and places them in a queue which will be processed by the XNA framework. If you come across such exception detailed above, you have to call the FrameworkDispatcher.Update() method once per frame in a timer loop. You can also implement the IApplicationService interface and use the timer Tick event.


Here is the sample implementation code for IApplicationService to update the FrameworkDispatcher:

public class DispatcherService : IApplicationService
    private DispatcherTimer m_dispatcherTimer;
    public DispatcherService()
        m_dispatcherTimer = new DispatcherTimer();
        m_dispatcherTimer.Interval = TimeSpan.FromTicks(10000);
        m_dispatcherTimer.Tick += frameworkDispatcherTimer_Tick;
    void frameworkDispatcherTimer_Tick(object sender, EventArgs e)
    void IApplicationService.StartService(ApplicationServiceContext context)
    void IApplicationService.StopService()


Now, you need to register this service in your application class (either XAML or Code behind). Here is the XAML code that you need to add in your App.xaml file:

    <service:DispatcherService />


I hope that this small tip will help you to fix the exception easily. You might have came to this page by searching the said exception message online. So, stay tuned to my blog for different articles on Technologies like Silverlight, Windows Phone, WPF, XAML, .NET and other stuffs.


Don’t forget to connect with me on Twitter and Facebook for technical updates and articles news. Also subscribe to my blog’s Newsletter to get all the updates delivered directly to your inbox. We won’t spam or share your email address as we respect your privacy.

If you have come this far, it means that you liked what you are reading. Why not reach little more and connect with me directly on Twitter, Facebook, Google+ and LinkedIn. I would love to hear your thoughts and opinions on my articles directly.

Also, don't forget to share your views and/or feedback in the comment section below.


  1. My family every time say that I am killing my time here at web, except I know I am getting familiarity daily by reading thes pleasant content.

    A. Chan

  2. Please help me to resolve this query on windows 8 metro.

    We are unable to loop the wav file with out any gap in Windows Phone 8 Metro. Wav file ends and start after 3-4 sec. I need to to loop the same wav file with out any gap in the background. We did the same in WP7 using XNA but in Metro, XNA is not available. Please suggest your valuable thought to resolve this issue.

  3. I am using XNA to play sound in a Silverlight application running in Windows. Why I am not able to FrameworkDispatcher class??
    I have 'Microsoft.Xna.Framework' in my using but the namespace does not seem to have the 'FrameworkDispatcher'.

    What is the problem here, as whatever search results i find including MSDN,says that 'FrameworkDispatcher' is part of the namespace 'Microsoft.Xna.Framework'????

  4. or you can use edit Application_UnhandledException function

    Public Sub Application_UnhandledException(ByVal sender As Object, ByVal e As ApplicationUnhandledExceptionEventArgs) Handles Me.UnhandledException

    ' Show graphics profiling information while debugging.
    If Diagnostics.Debugger.IsAttached Then
    End If

    If e.ExceptionObject Is Nothing OrElse e.ExceptionObject.Message Is Nothing Then
    End If

    If e.ExceptionObject.ToString().ToLower().Contains("frameworkdispatcher.update") Then
    'Stops the app from force closing
    'everything should continue to work without a problem
    e.Handled = True
    End If

    End Sub

  5. i am getting error on xaml implementation error message "the namespace prefix"service" is not defined ....how to remove error for this


© 2008-2018 Kunal-Chowdhury.com | Designed by Kunal Chowdhury
Back to top