標籤:http io os 使用 ar for sp 問題 on
找到了別人遇到和我一樣的問題:http://ylad.codeplex.com/discussions/430095(英文)
一位叫做Mister Goodcat的提供了資訊:
Short answer: XPath is not supported on the phone. If you want to use HTML Agility Pack, use the LinqToXml features instead.
Long version:
Enabling the XPath features on Windows Phone only works, as you stated, when you add a reference to the System.Xml.XPath assembly of the Silverlight 4 SDK. This is considered an unsupported workaround to add XPath support to Windows Phone which worked in the past on 7.x (also note the warning you receive in Visual Studio when you add the reference, about unexpected behavior). In Windows Phone 8, this trick doesn‘t seem to work anymore (see also Mathias comment here, for example).
Apparently there now is a System.Xml.XPath assembly (version 4.0.0.0, as opposed to version 2.0.5.0 from the Silverlight SDK) that is internally used by the XAML page loader. Now when you add the Silverlight SDK version the result is a conflict between these involved assemblies that cannot be resolved.
是因為System.Xml.XPath 衝突了。並建議在使用HTML Agility Pack時不要使用System.Xml.XPath,而可用LinqToXml替代。
而且HTML Agility Pack在WP8 WP8.1上也缺少方法,導致不能使用Xpath來解析
所以不掙紮了,現在開始要學習LINQ TO XML了。
不掙紮了,開始學習LINQ TO XML,進而來解析網頁。