Uri.IsWellFormedUriString 的 WP 7 实现中的错误? [英] Bug in WP 7 implementation of Uri.IsWellFormedUriString?

查看:20
本文介绍了Uri.IsWellFormedUriString 的 WP 7 实现中的错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 .NET 4 控制台应用程序和 Silverlight 4 应用程序中,以下返回false:

Uri.IsWellFormedUriString("/test", UriKind.Absolute)

但在 Windows Phone 应用程序(7.0 或 7.1 使用 SDK 7.1 Beta 2 发布 6/29/11)中的相同调用返回 true.

其他人可以确认这一点吗?这是 WP7 中的错误吗?

更新

我将此报告为 Microsoft Connect 并在今天收到更新,它已被关闭为无法修复".这对我来说无关紧要,但我想我会添加此更新仅供参考.

解决方案

文档 这是一个错误:

<块引用>

一个布尔值,如果字符串符合 RFC 3986 的格式,则该值为真;否则为假.

RFC 3986 说:

<块引用>

absolute-URI = scheme ":" hier-part [ "?"查询]

因此最好在 Microsoft Connect 上提交此错误,并在 VS 下引用手机开发工具的工具版本.>

In a .NET 4 console application, and a Silverlight 4 application, the following returns false:

Uri.IsWellFormedUriString("/test", UriKind.Absolute)

but the same call in a Windows Phone app (7.0 or 7.1 using SDK 7.1 Beta 2 published 6/29/11) returns true.

Can anyone else confirm this? Is this a bug in WP7?

Update

I reported this as a bug on Microsoft Connect and received an update today that it has been closed as "Wont' Fix". This doesn't matter to me but I thought I would add this update just as an FYI.

解决方案

After the documentation its a bug:

A Boolean value that is true if the string was well-formed in accordance with RFC 3986; else false.

And the RFC 3986 says:

absolute-URI = scheme ":" hier-part [ "?" query ]

So better submit this bug on Microsoft Connect under VS referencing the Tooling Version for phone development tools.

这篇关于Uri.IsWellFormedUriString 的 WP 7 实现中的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆