📜 ⬆️ ⬇️

Using Portable Class Libraries with Windows Phone 7.5 Support in Visual Studio 2013

As you know, in Visual Studio 2013, application development for Windows Phone 7 is no longer supported. At the same time, only in version 13, you can develop applications for Windows 8.1. It would be ok if the Portable Class Libraries (PCL) also didn’t touch support for WP7. When you first start the project, the 13th Visual Studio offers to convert the cross-platform PCL project, leaving only support for Windows Phone 8.
Without arguing about the feasibility of this decision and the motivation of Microsoft, we note that many developers have a more or less tangible percentage of the user base using Windows Phone 7 devices. At the same time I want to use all the goodies that a new version of Visual Studio provides to the developer.
The solution to the problem is offered under the cut.

So, there are two ways out of this situation:
1. Make a willful decision and refuse to support Windows Phone 7 version of the application.
2. Maintain two branches of PCL libraries.
Naturally, none of these solutions is optimal and carries with it certain problems.

As it turned out, there is also an “alternative” way to solve the problem.
The solution was found by Johan Laanstroy and described in his personal blog . The author was puzzled by the solution of the problem at a time when Visual Studio 2013 was in the release candidate stage. The solution comes down to editing the .NET Framework configuration files for PCL libraries. As rightly noted in the article, this “hack” is not an official solution and introduces Visual Studio in an unsupported state. Accordingly, the problems this solution may entail the most unpredictable. From myself I can say that for the week of development no problems were noticed.

Sequencing:
1. In the folder ... \ Program Files (x86) \ Reference Assemblies \ Microsoft \ Framework \ .NETPortable \ v4.0 \ Profile \ Profile104 \ SupportedFrameworks / we find the “Silverlight 4.xml” and “Windows Phone 7.5” XML configuration files .xml ”
2. We fix in each of them the value of the MaximumVisualStudioVersion property from “11.0” to “12.0”.
3. Restart the studio if necessary. I also had to restart Resharper in Visual Studio, but my case is rare.
')
Now you can continue to develop using one version of PCL libraries. Visual Studio 2012 is used to develop Windows Phone 7/8 applications, and 2013 version is used for Windows 8 and 8.1 applications.

Thanks for attention!

Source: https://habr.com/ru/post/207690/


All Articles