简体   繁体   English

Windows应用商店的.NET中不存在UriFormatException

[英]UriFormatException does not exist in .NET for Windows Store apps

Any idea how Uri.EscapeDataString() can throw a System.UriFormatException but it does not appear to be possible to catch it explicitly? 知道Uri.EscapeDataString()如何引发System.UriFormatException,但似乎无法明确捕获它吗?

If I try to catch it explicitly I just get "type or namespace name 'UriFormatException' does not exist in the namespace 'System'" 如果我尝试明确地捕获它,我只会得到“类型或名称空间名称'UriFormatException'在名称空间'System'中不存在”

According to Uri constructor help in MSDN: 根据MSDN中Uri构造函数的帮助:

In the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, FormatException, instead. 在用于Windows Store应用程序的.NET或可移植类库中,捕获基类异常FormatException。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM