.netc#-4.0windows-phone-7windows-phone-7.1

WP 7 project denies hides some .Net libraries


I am trying to use an API for my windows phone project.

The API works very fine when I am using it for a console application.

But when I imported the classes to a wp7 project these lines made an error:

using System.Web;
using System.Web.Security;
using System.Xml.XPath;

When I try to add their reference, it doesn't appear in the list of .Net references unlike in a regular C# console application, any solution to that?


Solution

  • Many of the APIs in desktop .NET aren't available on Windows Phone 7. Look in MSDN and select Silverlight as the version, and you can see which members are supported for any particular class when they have a little phone icon next to them.

    For example, most of System.Web is for writing web server code - not exactly relevant on a mobile phone. Looking at XElement, it doesn't look like the XPath-related methods are available on WP7 either.

    Basically you'll need to work out why (or if) the API needed that functionality, and see if you can remove it.