I'm developing a WinUI3 based app and I need to restart the app to apply some settings. But I can't find a function to do that. I noticed that there is a method--CoreApplication.RequestRestartAsync. However, it only shut the app down but didn't open the app. Is there an API can restart a WinUI app?
Is there a function that can restart a WinUI app?
126 views Asked by Sciencekill At
2
There are 2 answers
2
mm8
On
The suggested Restart API is probably a good place to start.
You should also be able to start a new process like you would start any other .NET process:
string path = Process.GetCurrentProcess().MainModule.FileName;
Process process = Process.Start(new ProcessStartInfo(path));
IntPtr intPtr = IntPtr.Zero;
do
{
intPtr = process.MainWindowHandle;
}
while (intPtr == IntPtr.Zero);
Environment.Exit(0);
Related Questions in UWP
- How to make that each seller has its own different set of products using sqlite and uwp
- How can i solve SQLITE_IOERR_SEEK on Unreal UWP application on MS Hololens2
- UWP Blank app throws error code: The app didn't start.. Activation phase: COM ActivateExtension
- How can I tell if a control is actually Visible in UWP?
- DEP0700: Registration of the app failed UWP in release mode
- Linker errors when adding a native c++ static library to Windows runtime component (UWP)
- uwp app only accepts input whenever i have opened on conhost/powershell/cmd
- uwp - WebAuthenticationBroker does not show cloudflare captcha
- How do I get the typename of an arbitrary XAML FrameworkElement?
- Apryse PDFTron SetDoc method throws AccessViolationException
- How do you know which items are realized (non-virtualized) in an ItemsRepeater?
- How to copy or drag n drop image from Webview2 to Canvas?
- UWP app Shutdown PC don't work in kiosk mode
- Path denied error when building UWP app in release
- Display Data from Drive D: in the Gridview
Related Questions in WINUI-3
- Binding data with unknown columns to a DataGrid in WinUI 3
- How can I force a .NET MAUI ContentView to fill the entire remaining space of its FlexLayout parent?
- x:Bind a embeded page to the parent window viewmodel in WinUI 3
- What the equivalent to LocalPrintServer and PrintQueue that can be used in WinUI
- ScrollViewer does not adjust accordingly to image scaling
- Why my MAUI control isn't visible but still interractive
- In C# WinUI, a crash about "System. ExecutionInexception" is caused for unknown reasons
- WinUI 3 TemplateStudio Read from local settings using the LocalSettingsService
- How to obtain the real-time properties of a custom title bar in C++/WinRT WinUI3
- How do you know which items are realized (non-virtualized) in an ItemsRepeater?
- Can I use a WindowsFormsHost in a WinUI3 application?
- OAuth implementation with WINUI unpackaged app not working
- WindowsAppSDK resource file modification requires rebuild
- WINUI3 Packaged App: Copy folders/files during installation locally
- Runtimes Directories Are Being Generated Only in Debug Mode With MSBuild
Related Questions in APPLICATION-RESTART
- Is there a function that can restart a WinUI app?
- Looking for strategies to check if a system has been restarted
- Find, stop and restart a process with bash script
- Getting error while using RestartApp in flutter
- embedded jetty 9 restarting the server in every 3 minutes
- How to let windows to restart a .net service on failure
- After restarting flutter app, the added elements to the list are removed and from UI too
- How do I close my Flutter app programmatically on iOS?
- Docker: Nodemon is syncing but not re-running
- NullPointerException: null cannot be cast to non-null type kotlin.Int. When calling navController.setGraph after restarting Activity
- android, why save to prefs does not work if restart app too soon?
- Restart a file on change python watchdog
- How do I add a restart button in html javascript flappy bird type game?
- terminals aren't opening in restart script
- UWP C# How To Auto Restart UWP App if it Crashes
Related Questions in WINDOWS-APP-SDK
- WinUI 3 localized strings resources don't work when app is built using dotnet build command
- How to access XamlRoot from a non-UI thread?
- How to build a C# WinUI 3 unpackaged app with command line
- Is Windows App SDK related/connected to UWP?
- How to Detect Display Orientation Change in WinUI 3 with WindowEx Without CoreWindow Thread Error?
- Mocking Windows APP SDK classes using C++/winrt
- Is there a function that can restart a WinUI app?
- Adaptive triggers are not triggering when the min width condition satifies - WinAppSDK; WinUI 3;
- Issue while creating the Channel URI for push notifications in Windows
- Can I embed a windows app installer in my app for automatic updates if I intend to sell the app both on the store and my own website?
- Getting bad request error in Windows push notifications using Windows App SDK
- Image Gradient in WinUI3
- Error APPX1101 (when building MAUI/Windows-App): Payload contains two or more files with the same destination path 'README.md' when referencing nugets
- WinUI 3- ; expected error comes after adding C1.WinUI.Grid package in WinUI blank project
- How to Change the Page headers made by Winui 3 Template Studio
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Try the Restart API: