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. Everything would be fine if the rejection of support for WP7 did not touch Portable Class Libraries (PCL). At the first launch of the project 13th, Visual Studio suggests converting a cross-platform PCL project, leaving only support for Windows Phone 8.
Without arguing about the appropriateness of this solution and the motivation of Microsoft, we note that many developers use a more or less tangible percentage of the user base on Windows Phone 7 devices. At the same time, I want to use all the goodies that the developer of the new version of Visual Studio provides.
A solution to the problem is proposed under the cut.
So, there are two
ways out of this situation: 1. Make a strong-willed decision and refuse to support Windows Phone 7 version of the application.
2. Support two branches of PCL libraries.
Naturally, not one of these solutions is not optimal and brings 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 to the problem even 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 puts Visual Studio in an unsupported state. Accordingly, even the most unpredictable problems can lead to problems. From myself, I can say that no problems were noticed during the week of development.
Procedure:
1. In the folder ... \ Program Files (x86) \ Reference Assemblies \ Microsoft \ Framework \ .NETPortable \ v4.0 \ Profile \ Profile104 \ SupportedFrameworks / we find the XML configuration files “Silverlight 4.xml” and “ Windows Phone 7.5.xml ”
2. In each of them we correct the value of the MaximumVisualStudioVersion property from “11.0” to “12.0”.
3. Restart the studio if necessary. In addition, I had to restart Resharper in Visual Studio, but my case is single.
Now you can continue to develop using one version of PCL libraries. For the development of Windows Phone 7/8 applications, Visual Studio 2012 is used, and for Windows 8 and 8.1 applications - 2013 version.
Thanks for attention!
Without arguing about the appropriateness of this solution and the motivation of Microsoft, we note that many developers use a more or less tangible percentage of the user base on Windows Phone 7 devices. At the same time, I want to use all the goodies that the developer of the new version of Visual Studio provides.
A solution to the problem is proposed under the cut.
So, there are two
ways out of this situation: 1. Make a strong-willed decision and refuse to support Windows Phone 7 version of the application.
2. Support two branches of PCL libraries.
Naturally, not one of these solutions is not optimal and brings 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 to the problem even 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 puts Visual Studio in an unsupported state. Accordingly, even the most unpredictable problems can lead to problems. From myself, I can say that no problems were noticed during the week of development.
Procedure:
1. In the folder ... \ Program Files (x86) \ Reference Assemblies \ Microsoft \ Framework \ .NETPortable \ v4.0 \ Profile \ Profile104 \ SupportedFrameworks / we find the XML configuration files “Silverlight 4.xml” and “ Windows Phone 7.5.xml ”
2. In each of them we correct the value of the MaximumVisualStudioVersion property from “11.0” to “12.0”.
3. Restart the studio if necessary. In addition, I had to restart Resharper in Visual Studio, but my case is single.
Now you can continue to develop using one version of PCL libraries. For the development of Windows Phone 7/8 applications, Visual Studio 2012 is used, and for Windows 8 and 8.1 applications - 2013 version.
Thanks for attention!