How to upgrade your app from Wp7 to Wp8

 

With the release of Windows Phone 8, Microsoft introduced a number of new features for developers to use in their apps. Aside from these new features, there have also been quite a few improvements to the platform such as resolutions and the inclusion of the Panorama, Pivot and LongListSelector controls in the ROM of the OS. In general, the Windows Phone app platform enables apps that target Windows Phone OS 7.1 to run without modification or recompilation on Windows Phone 8. But you may want to use some new features to differentiate your app from the others. You will find here a exhaustive list of modification App platform compatibility for Windows Phone.

 

They are multiple solution to approach this problem    

  • Create a separate copy of the app for each version. Easy to do but difficult to maintain, you ll have to replicate every update that you make in two places
  • Create two copies of the app that share a class library of common code. Two projects in the same solution and refactor common code into a shared class library project. but the class library project must target Windows Phone OS 7.1. With this approach, your shared class library can’t use any of the enhancements or new features introduced in WP 8.
  • Create two copies of the app that share linked source code files. A same solution that share source code and use conditional compilation constants in your code to isolate app features that are new in Windows Phone 8

 

Independently of the method you choose, you can easily upgrade an existing Windows Phone app project that targets Windows Phone OS 7.1 to target Windows Phone 8 by

In Solution Explorer, use the Upgrade to Windows Phone 8.0 command.

wp81

In the project designer, change the Target Windows Phone OS Version value to Windows Phone OS 8.0.

  • WP82

You cannot upgrade XNA Game Studio 4.0 projects to Windows Phone 8. For more info, see XNA Framework and Windows Phone 8 development.

 

Tips :

  • Advertising SDK. Windows Phone SDK 7.1 installs version 5.2 of the Microsoft Advertising SDK assembly. Windows Phone SDK 8.0 installs version 6.1 of the same assembly in the same path for apps that target Windows Phone OS 7.1. As a result, you can’t build the project successfully with Windows Phone SDK 8.0 either before or after upgrading the project. You must Manually remove the reference to the older version and add a reference to the newer version of the SDK assembly
  • Adding Windows Phone 8 Tile functionality to Windows Phone OS 7.1 apps. I invite you to check this blog post https://msdn.microsoft.com/en-us/library/windowsphone/develop/jj720574(v=vs.105).aspx

 

After the upgrade , don’t forget add references to your project for the assemblies that contain the new APIs, and import the namespaces into your code files and edit the manifest file, or run the Capability Validation test in the Windows Phone Store Test Kit. However the upgrade process automatically removes the deprecated ID_CAP_MEDIALIB capability and replaces it with the new ID_CAP_MEDIALIB_AUDIO, ID_CAP_MEDIALIB_VIDEO or ID_CAP_MEDIALIB_PHOTO capability as appropriate.

You will find here after the default app manifest for wp7 and wp8

Windows Phone 7

 

Windows Phone 8

<Deployment     xmlns="https://schemas.microsoft.com/       windowsphone/2009/deployment"     AppPlatformVersion="7.1">   <App       xmlns=""       ProductID="{<GUID>}"       Title="EmptyNewWP71Project"       RuntimeType="Silverlight"       Version="1.0.0.0"       Genre="apps.normal"       Author="EmptyNewWP71Project author"       Description="Sample description"       Publisher="EmptyNewWP71Project">     < IconPath         IsRelative="true"         IsResource="false">       ApplicationIcon.png     </IconPath>

<Deployment     xmlns="https://schemas.microsoft.com/       windowsphone/2012/deployment"     AppPlatformVersion="8.0">   < DefaultLanguage xmlns="" code="en-US"/>   <App       xmlns=""       ProductID="{<GUID>}"       Title="EmptyNewWP80Project"       RuntimeType="Silverlight"       Version="1.0.0.0"       Genre="apps.normal"       Author="EmptyNewWP80Project author"       Description="Sample description"       Publisher="EmptyNewWP80Project"       PublisherID="{<GUID>}">     < IconPath         IsRelative="true"         IsResource="false">       Assets\ApplicationIcon.png     </IconPath>

<Capabilities>   < Capability Name="ID_CAP_GAMERSERVICES"/>   < Capability Name="ID_CAP_IDENTITY_DEVICE"/>   < Capability Name="ID_CAP_IDENTITY_USER"/>   < Capability Name="ID_CAP_LOCATION"/>   < Capability Name="ID_CAP_MEDIALIB"/>   < Capability Name="ID_CAP_MICROPHONE"/>   < Capability Name="ID_CAP_NETWORKING"/>   < Capability Name="ID_CAP_PHONEDIALER"/>   < Capability Name="ID_CAP_PUSH_NOTIFICATION"/>   < Capability Name="ID_CAP_SENSORS"/>   < Capability Name="ID_CAP_WEBBROWSERCOMPONENT"/>   < Capability Name="ID_CAP_ISV_CAMERA"/>   < Capability Name="ID_CAP_CONTACTS"/>   < Capability Name="ID_CAP_APPOINTMENTS"/> < /Capabilities>

<Capabilities>   < Capability Name="ID_CAP_NETWORKING"/>   < Capability Name="ID_CAP_MEDIALIB_AUDIO"/>   < Capability Name="ID_CAP_MEDIALIB_PLAYBACK"/>   < Capability Name="ID_CAP_SENSORS"/>   < Capability Name="ID_CAP_WEBBROWSERCOMPONENT"/> < /Capabilities>

<Tokens>   < PrimaryToken       TokenID="EmptyNewWP71ProjectToken"       TaskName="_default">     <TemplateType5>       < BackgroundImageURI           IsRelative="true"           IsResource="false">         Background.png       </BackgroundImageURI>       <Count>0</Count>       < Title>EmptyNewWP71Project</Title>     </TemplateType5>   </PrimaryToken> < /Tokens>

<Tokens>   < PrimaryToken       TokenID="EmptyNewWP80ProjectToken"       TaskName="_default">     < TemplateFlip>       < SmallImageURI           IsRelative="true"           IsResource="false">         Assets\Tiles\FlipCycleTileSmall.png       </SmallImageURI>       <Count>0</Count>       < BackgroundImageURI           IsRelative="true"           IsResource="false">         Assets\Tiles\FlipCycleTileMedium.png       </BackgroundImageURI>       < Title>EmptyNewWP80Project</Title>       < BackContent></BackContent>       < BackBackgroundImageURI>       </BackBackgroundImageURI>       < BackTitle></BackTitle>       < DeviceLockImageURI>       </DeviceLockImageURI>       < HasLarge></HasLarge>     </TemplateFlip>   </PrimaryToken> < /Tokens>

 

<ScreenResolutions>   < ScreenResolution Name="ID_RESOLUTION_WVGA"/>   < ScreenResolution Name="ID_RESOLUTION_WXGA"/>   < ScreenResolution Name="ID_RESOLUTION_HD720P"/> < /ScreenResolutions>

<Tasks>   < DefaultTask     Name ="_default"     NavigationPage="MainPage.xaml"/> < /Tasks>

<Tasks>   < DefaultTask     Name ="_default"     NavigationPage="MainPage.xaml"/> < /Tasks>

  </App> < /Deployment>

  </App> < /Deployment>