3

I've been working on a Windows Phone 8 app, which I now want to change to be Windows Phone 8.1. How can I do this?

Should I create a new Windows Phone 8.1 app and copy all my existing files into it? Or is there an automated way for me to upgrade the existing solution to 8.1?

DaveDev
  • 41,155
  • 72
  • 223
  • 385
  • 1
    When you open your App in VS2013 and right click on your project then you should see an option *Retarget to Windows Phone 8.1*. See if that helps. Don't forget to make a backup - it's *one-way*. – Romasz Jul 08 '14 at 08:41
  • that seems to have done the trick! Thanks – DaveDev Jul 08 '14 at 08:49
  • 1
    "Retarget to Windows Phone 8.1" will make Silverlight 8.1 app not WinRT 8.1 app. – Faisal Jul 08 '14 at 16:06

1 Answers1

9

There are two ways to do that:

  • like in comment - right click on oyour project and you should see Retarget to Windows Phone 8.1
  • or you can open Properties window of your project and the in dropdown box Target Windows Phone OS version you can choose Windows Phone 8.1

In every case the VS should ask if you are sure to do that - it's one-way operation, so it's worth to make a backup of your solution. As WP8.1 has backward compability, in most cases there shouldn't be any problems.


Some clarification for the followers:

As WP8.0 apps are Silverlight, after retargetting it will still be a Silverlight app but WP8.1 (some new features and enhancemens).

Thought, if you want to retarget to WP8.1 Runtime, it's a totally different thing - it's a different type of an app, different API and more. You will have to port it manually. Note that not all features from WP8.0 are yet available in WP8.1 Runtime - here is a good article about that.

Romasz
  • 29,662
  • 13
  • 79
  • 154
  • Thanks for the extra clarification on this. It's really helped my understanding of what I'm faced with. I spent a lot of time yesterday pulling my hair out trying to understand why my app, while it appeared to be "Windows Phone 8.1" had different properties and behaviours to a "Windows Phone 8.1" app. It seems Microsoft have really dropped the ball on this. – DaveDev Jul 09 '14 at 08:14
  • 1
    @DaveDev I'm glad it helped. Yeah, it also took me a while to understand what's going on. Just to add - when you port to WP8.1 Runtime - also look out for [different app lifecycle](http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh464925.aspx), there are some pitfalls, and one of my favourites - `OnNavigatedTo()` is not getting called after resuming event. Also when you debug suspending/resuming is not fired unless you invoke it. – Romasz Jul 09 '14 at 08:23
  • just reinforce what @Romasz said: when under debugger,WP wouldn't trigger "suspend" event as it should (eg. when you navigate away from the app by pressing start button, back button (from app first screen) or via task switcher). Instead the app would disappear from the screen but still run and be active as if it is still in foreground). To simulate normal lifecycle of app under debugger you need in VS turn on toolbar "Debug location" and press "Suspend" button there. When you run your app without debugger, the "suspend" event would be triggered as promised once app goes off screen. Tricky. – Dimitry K Jul 07 '15 at 16:04
  • 1
    @DimitryK Just [a reference to what you have said](http://stackoverflow.com/a/24103734/2681948). – Romasz Jul 07 '15 at 17:58