Floating FB popout byF5debug

101 How to on Windows Phone – How to #84 – How to Build apps for both Windows Phone Versions (7.1 and 8.0)

 

In this article we are going to see how we can build an app that target only Windows Phone Version 7.1 or only Windows Phone 8.0 or both the versions with out much of creating code base. This approach is much needed when we develop apps targeting the SDK of which the application should be developed and showcased in the Market. So the default option to do is to have 2 separate versions of Windows Phone Project code base of targeting each version separately which will be more painful in maintaining the application as a single change should affect in both the source code. [more]

Let us see how we can achieve this task by building a common Class Library that can be shared across the different project versions so that changes that affect in the single class library will be affected in both the versions of the application. Open Visual Studio 2012 IDE in administrator mode and create a new project for Windows Phone which is targeting Windows Phone 7.1 version as shown in the screen below.

image

Clicking on OK will create the project and the solution with the list of default files and folders that are required to run the application. It will take some time to create these files based on your system configuration, so once everything is ready we can see the Visual Studio IDE with the project as shown in the screen below.

image


Right click on the Solution and click on Add –> New Project to open the add new window to add a Windows Phone Class Library which can be used to place all the business logic that can be shared across the different versions as shown in the screen below.

image


Click on ok will popup a window to select the version we planned to target, just select the base version Windows Phone Version 7.1 from the available list as shown in the screen below.

image

Now clicking on OK will create the base class library in which we can refract the code that are much needed to share in both the application projects. Refer the class library in the base application project which we created targeting the Windows Phone 7.1 version as shown in the screen below.

image


Next step is to use the same code base (shared library) in the Windows Phone application that targets version 8.0, Click on the project solution and click on Add new project to create a new Windows Phone application which targets 8.0 version and refer the same shared class library. This approach will avoid to make changes to the business requirement in both the project application targeting the different versions of the OS.

About Author: Karthikeyan Anbarasan, Microsoft MVP (Most Valuable Professional) in ASP.NET/IIS Architecture. He is the Founder and Chief Editor of the www.f5debug.net website and has authored books on Windows Phone and Business Intelligence(SSIS). He is also a Passionate Speaker and a Blogger on Microsoft Technologies.

You can Join Me On: Facebook, Twitter, Google Plus, LinkedIn

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Recent Posts

Random Posts

Most Viewed

URL Shortner

Create your own short urls!!!

Site Counter

free counters

Disclaimer

This is a personal weblog. The opinions expressed here represent my own and not those of my employer. For accuracy and official reference refer to MSDN/ TechNet. I have documented my personal experience on this blog.

Protected by Copyscape Web Plagiarism Finder

Site Meter