{"id":10702,"date":"2015-11-30T10:00:00","date_gmt":"2015-11-30T10:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2015\/11\/30\/debug-uwp-prelaunch-with-vs2015\/"},"modified":"2022-08-02T23:26:35","modified_gmt":"2022-08-03T07:26:35","slug":"debug-uwp-prelaunch-with-vs2015","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/debug-uwp-prelaunch-with-vs2015\/","title":{"rendered":"Debug UWP Prelaunch with VS2015"},"content":{"rendered":"<p>On Windows 10, <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/apps\/xaml\/mt593297.aspx\">the startup performance of Universal Windows Platform (UWP) apps is improved by proactively launching and then suspending apps in\u00a0a technique\u00a0called Prelaunch<\/a>. Many applications will not need to do anything special to work in this mode, but some applications may need to adjust their behavior, for example an application that shows animations that the user needs to see on startup, or a messaging app that changes the user\u2019s online status. To help debug any issues in these code paths <a href=\"https:\/\/www.visualstudio.com\/news\/vs2015-update1-vs\">Visual Studio 2015 Update 1<\/a> and <a href=\"https:\/\/blogs.windows.com\/windowsexperience\/2015\/11\/12\/first-major-update-for-windows-10-available-today\/\">Windows 10 Version 1511 (November 2015 Update)<\/a> added support that enable you to start debugging the app from Visual Studio in Prelaunch mode.<\/p>\n<p>Debugging is supported both from a Visual Studio project, and for apps already installed on the machine (e.g. if you need to debug an app built in a lab and deployed for testing purposes).<\/p>\n<p>A few things to note:<\/p>\n<ul>\n<li>For debugging Prelaunch to work correctly you need both Visual Studio 2015 Update 1 and the <a href=\"https:\/\/blogs.windows.com\/windowsexperience\/2015\/11\/12\/first-major-update-for-windows-10-available-today\/\">Windows 10 Version 1511<\/a> installed on your machine otherwise you will receive an error that the \u201cWindows Store app could not be activated\u201d<\/li>\n<li>Currently Prelaunch will only work when debugging on a Desktop edition of Windows 10 (Home, Pro, Enterprise, and Education)<\/li>\n<li>If your app needs to change its startup behavior based on which mode it is launched in, this is done by checking the value of the <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/apps\/windows.applicationmodel.activation.launchactivatedeventargs.prelaunchactivated.aspx\">PrelaunchActivated property<\/a> on the <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/apps\/windows.applicationmodel.activation.launchactivatedeventargs.aspx\">LaunchActivatedEventArgs<\/a> parameter in the OnLaunched method if your app\u2019s App.xaml.cs file<br \/>\n<img decoding=\"async\" style=\"padding-top: 0px;padding-left: 0px;padding-right: 0px;border: 0px\" title=\"clip_image002\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/11\/7002.clip_image002_thumb_019DEBA5.jpg\" alt=\"clip_image002\" width=\"628\" height=\"202\" border=\"0\" \/><\/li>\n<\/ul>\n<p>To start debugging a Visual Studio project in Prelaunch mode, choose Debug -> Other Debug Targets -> Debug Universal Windows App Prelaunch.<\/p>\n<p><img decoding=\"async\" style=\"padding-top: 0px;padding-left: 0px;padding-right: 0px;border: 0px\" title=\"clip_image004\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/11\/3704.clip_image004_thumb_0850F528.jpg\" alt=\"clip_image004\" width=\"627\" height=\"223\" border=\"0\" \/><\/p>\n<p>To start debugging Prelaunch in an app that is already installed on the machine, choose Debug -> Other Debug Targets -> <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/hh781607.aspx#BKMK_Start_an_installed_app_in_the_debugger\">Debug Installed App Package\u2026<\/a> Then, in the selection dialog that appears choose the app and check \u201cActivate app with Prelaunch\u201d<\/p>\n<p><img decoding=\"async\" style=\"padding-top: 0px;padding-left: 0px;padding-right: 0px;border: 0px\" title=\"clip_image006\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/11\/7723.clip_image006_thumb_5D0C5E20.jpg\" alt=\"clip_image006\" width=\"449\" height=\"427\" border=\"0\" \/><\/p>\n<p>You will know the app was started in Prelaunch mode because the PrelaunchActivated property will be true.<\/p>\n<p><em><img decoding=\"async\" style=\"padding-top: 0px;padding-left: 0px;padding-right: 0px;border: 0px\" title=\"clip_image008\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/11\/4174.clip_image008_thumb_1CD644A6.jpg\" alt=\"clip_image008\" width=\"627\" height=\"134\" border=\"0\" \/><\/em><\/p>\n<p>We hope you find this functionality useful and please let us know if you have any questions or problems below in the comments section, using the <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/b8akas30.aspx\">Send Feedback feature in Visual Studio<\/a>, or <a href=\"https:\/\/twitter.com\/vs_debugger\">through twitter<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On Windows 10, the startup performance of Universal Windows Platform (UWP) apps is improved by proactively launching and then suspending apps in\u00a0a technique\u00a0called Prelaunch. Many applications will not need to do anything special to work in this mode, but some applications may need to adjust their behavior, for example an application that shows animations that [&hellip;]<\/p>\n","protected":false},"author":68,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,225],"tags":[],"class_list":["post-10702","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-git"],"acf":[],"blog_post_summary":"<p>On Windows 10, the startup performance of Universal Windows Platform (UWP) apps is improved by proactively launching and then suspending apps in\u00a0a technique\u00a0called Prelaunch. Many applications will not need to do anything special to work in this mode, but some applications may need to adjust their behavior, for example an application that shows animations that [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/10702","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/68"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=10702"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/10702\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=10702"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=10702"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=10702"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}