CoreApplication.RestartApplicationOnly Method

RestartApplicationOnly restarts the application without restarting the virtual machine the application is running in.

Use RestartApplicationOnly in your title to terminate the current instance of the title and start a new instance.

A common use of RestartApplicationOnly is when a title is structured to use different DLLs when playing different game modes, such as single player vs. multiplayer. Rather than loading DLLs for both modes at all times, title code can switch from one mode to the other by calling RestartApplicationOnly and specifying in the args parameters that indicate the new mode. When the title code restarts, it can load the appropriate DLLs for the new mode, and avoid loading DLLs that will not be used.

Note If multiple versions of the same title exist, for example release, debug, etc., the currently running version will be launched again when the title is restarted. This occurs even if a default App User Mode ID has been previously set using xbapp setdefaultapp.

Syntax

public:
static void RestartApplicationOnly(
         String^ args,
         User^ context
)  

Parameters

args
Type: String 

 Launch arguments to pass to the application when it restarts.

context
Type: User 

The user that will be set as the current user when the application restarts.

Remarks

RestartApplicationOnly does not restart the virtual machine the title is running in and as a result is much quicker than the other Restart methods.

RestartApplicationOnly does not use protocol activation like the Restart methods. Instead, the app gets launch activated.

If the DXGIX_PRESENT_PRESERVE_FRAMEBUFFER flag is specified when calling IDXGISwapChain.Present the screen will not go black while the application shuts down and restarts after calling RestartApplicationOnly.

Requirements

Namespace: Windows.ApplicationModel.Core

Metadata: windows.winmd

See also

Reference

CoreApplication Class

CoreApplication Members

Windows.ApplicationModel.Core Namespace