VS2013: upgrading a Windows Phone 7/8 and Windows 8 apps(转)
VS2013: upgrading a Windows Phone 7/8 and Windows 8 apps
In this post I will showcase issues I had while upgrading a Visual Studio 2012 solution containing a Windows Phone app (with both 7.8 and 8.0 versions) and Windows Store app to Visual Studio 2013.
As you probably already know, the Release Candidate version of VS2013 was released a few days ago and I decided it was the appropriate time to upgrade my 2Day todo-list application. Because 2Day for Windows will target the 8.1 release (coming October 18th, now available for MSDN subscribers) I needed to perform this upgrade before the release.
Windows Phone 7.x support
The first issue is simple and yet sad: Visual Studio 2013 is dropping support for Windows Phone 7.x app. I guess it makes sense when given the fact the WP8 devices represent more than 65% of the total of Windows Phone device (see this AdDuplex blog post for more details).I can also confirm this trend that by looking at 2Day’s data for last week:

Since I released the first version of 2Day I submitted 14 updates. Starting from 2Day 1.4 I released all updates for both WP7 and WP8 devices. It looks like the 2.1 update coming later this month will be the last one targeting WP7 devices.
Windows Phone support Conclusion: upgrade to VS2013 imply no more WP7 support. You can try to maintain 2 solutions but we will see in the next paragraph that there are other issues with Portable Class Libraries.
Portable Class Libraries (PCL)
2Day’s Visual Studio 2012 solution contains Portable Class Libraries to enable code reuse between Windows Phone and Windows 8 (it was also helping code sharing between WP7 and WP8 versions). In Visual Studio 2013, like we saw before, support for WP7 is now longer available, including for PCLs:

So opening a solution that contains PCLs targeting WP7 will upgrade those PCLs and drop targeting of WP7.
Also, in order to target WP7 and have async/await support I had to use the Async BCL NuGet package:

Because the async support is now supported in the frameworks I target (Windows 8.1 and Windows Phone 8), I must remove those packages in order to prevent conflicts like the following:
Error 28 The type 'System.Threading.Tasks.Task<TResult>' exists in both 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile158\mscorlib.dll' and '...\packages\Microsoft.Bcl.1.0.19\lib\portable-net40+sl4+win8+wp71\System.Threading.Tasks.dll'
While doing those upgrades I also ended up target .Net 4.5, and it turns out the reflection API has some changes in the latest version of .Net. If you’re like me you’re a fan of SOLID principles, you probably have some kind of Inversion of Control container using reflection… In my case the following code was not working anymore:
var constructor = typeof(T).GetConstructors().FirstOrDefault();
And I had to use the new reflection API:
var constructor = typeof(T).GetTypeInfo().DeclaredConstructors.FirstOrDefault();
You can read this complete post on the blog of the .Net team for more details about the evolution of the reflection API.
PCL Conclusion: be careful when you upgrade PCL projects to VS2013. Because WP7 support is gone, you don’t need the Async BCL NuGet package anymore. If you choose to target .Net 4.5 beware of possible breaking changes in the reflection API.
General conclusion: if like me your original plan was to target WP7, WP8 and Windows 8.1 withing a single Visual Studio solution, you’re in trouble. My decision is to drop support for WP7 devices for the next update of my app. I guess I could go with branching in TFS to keep compatibility but I don’t have time for that. Be also careful with PCLs and the new reflection API.
VS2013: upgrading a Windows Phone 7/8 and Windows 8 apps(转)的更多相关文章
- Setting up a EDK II build environment on Windows and Linux:搭建Windows和Linux开发环境[2.2]
Setting up a EDK II build environment on Windows and Linux:搭建Windows和Linux开发环境[2.2] 2015-07 北京海淀区 ...
- U盘启动盘的制作--用U盘硬装Windows系统、或是重装Windows系统
借助IT天空的优启通U盘启动盘的制作--用U盘装Windows系统.或是重装Windows系统之U盘启动盘的制作 1.==================================== 2.== ...
- Windows Azure Active Directory (2) Windows Azure AD基础
<Windows Azure Platform 系列文章目录> Windows Azure AD (WAAD)是Windows Azure提供的一个REST风格的服务,为您的云服务提供了身 ...
- C#制作Windows service服务系列二:演示一个定期执行的windows服务及调试(windows service)
系列一: 制作一个可安装.可启动.可停止.可卸载的Windows service(downmoon原创) 系列二:演示一个定期执行的windows服务及调试(windows service)(down ...
- Windows 安装程序无法将 Windows 配置为在此计算机的硬件上运行
遇到这个问题是用辅助工具(WinNTSetup3.exe)进行的安装,重启后就就遇到“Windows 安装程序无法将 Windows 配置为在此计算机的硬件上运行” 解决:在WIN PE 下挂载安装光 ...
- Windows Kernel Way 1:Windows内核调试技术
掌握Windows内核调试技术是学习与研究Windows内核的基础,调试Windows内核的方式大致分为两种: (1)通过Windbg工具在Windows系统运行之初连接到Windows内核,连接成功 ...
- 如何在Windows中打开多个Windows Media Player
博客搬到了fresky.github.io - Dawei XU,请各位看官挪步.最新的一篇是:如何在Windows中打开多个Windows Media Player.
- 您在基于 Windows 7 的或基于 Windows Server 2008 R2 的计算机上读取器中插入智能卡时出现错误消息:"设备驱动程序软件未能成功安装"
http://support.microsoft.com/kb/976832/zh-cn http://support.microsoft.com/kb/976832/zh-tw 症状 当智能卡插入智 ...
- [Windows Phone]解锁、注册Windows Phone实体手机为开发机(Windows 8)
原文:[Windows Phone]解锁.注册Windows Phone实体手机为开发机(Windows 8) 前言 ? ? 最近要开发Windows Phone(以下简称WP)的手机游戏,由於使用模 ...
随机推荐
- HTTP 战役 与 历史
导火线1992年,有一家公司Nombas 开发了一种叫C--的嵌入式脚本语言,后来觉得名字比较晦气,最终改名为scriptEase.而这种可以嵌入网页中的脚本的理念,成为日后移动互联网蓬勃发展的一块重 ...
- HttpClient模拟http请求
Http协议的重要性相信不用我多说了,HttpClient相比传统JDK自带的URLConnection,增加了易用性和灵活性(具体区别,日后我们再讨论),它不仅是客户端发送Http请求变得容易,而且 ...
- FCM算法
FCM算法是一种基于划分的聚类算法,它的思想就是使得被划分到同一簇的对象之间相似度最大,而不同簇之间的相似度最小.模糊C均值算法是普通C均值算法的改进,普通C均值算法对于数据的划分是硬性的,而FCM则 ...
- UFS
● UFS vs eMMC 1. UFS有分离的读写通道,可以同时进行读写操作(双向),但是eMMC在同一时刻只能读或写. 2. UFS有一个命令队列,将命令进行排序.因此,多个命令可以同时处理,从而 ...
- 接口测试从未如此简单 - Postman (Chrome插件)
接口测试从未如此简单 - Postman (Chrome插件) 一个非常有力的Http Client工具用来测试Web服务的, 我这里来介绍如何用它测试restful web service 注:转载 ...
- rabbitmq之amqp queue
rabbitmq作为一个消息中间件,暂存信息的能力是必不可少的. 镜像队列
- 前台 JSON对象转换成字符串 相互转换 的几种方式
在最近的工作中,使用到JSON进行数据的传递,特别是从前端传递到后台,前台可以直接采用ajax的data函数,按json格式传递,后台Request即可,但有的时候,需要传递多个参数,后台使用requ ...
- 如何把自己打造成技术圈的papi酱
最近半年,一个叫papi酱的平胸女子连续在微博.朋友圈.创业圈刷屏,当之无愧成了中文互联网的第一大网红.呃,你以为我会巴拉巴拉说一堆网工创业的事?NO,今天想借papi酱的话题跟大家一起聊聊程序员如何 ...
- java程序中调用Linux命令Windows命令
目前总结的方法: 调用Linux简单的命令行,设置文件夹权限755 String scriptDir = "/home/wenf"; String cmd = "chmo ...
- zabbix自动发现监控url
1.在监控客户机上 web_site_code_status.sh: #!/bin/bash UrlFile="/opt/scripts/WEB.txt" IFS=$'\n' we ...