简体   繁体   中英

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?

If I try to catch it explicitly I just get "type or namespace name 'UriFormatException' does not exist in the namespace 'System'"

According to Uri constructor help in MSDN:

In the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, FormatException, instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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