缺少PCL中的System.UriFormatException类

时间:2017-06-20 07:09:19

标签: c# exception portable-class-library

我的crossplatform应用程序抛出System.UriFormatException,但我无法捕获它,因为它不存在!在我的Visual Studio 2015中的PCL库中看不到类System.UriFormatException。我正在尝试许多不同的PCL配置文件 - 没有效果,但仍然缺少例外。但是当为.net 4.5或Android创建简单库时,可以使用System.UriFormatException。

我的IDE有问题吗?

如何捕获此异常?

修改

UriFormatException 不适用于PCL,但仍抛出此异常,我需要处理它。我可以通过简单地将类型名称与字符串“UriFormatException”进行比较来捕获所有异常并识别 UriFormatException 。是否有另一种更优雅的方法来解决问题?

0 个答案:

没有答案
相关问题