问题
Namespace Microsoft.Phone.Tasks
is not available in XAML page code behind file of my Windows Phone application. Please see the screenshot.

In the properties windows of the project I see:
Target: Windows Phone 8.1
Am I missing an assembly reference or something?
回答1:
Windows Phone 8.1 XAML apps don't have Microsoft.Phone.Tasks namespace to make common UI framework with windows Runtime APIs. Still you can code up a few tasks by using Windows.ApplicationModel namespace. As you havent claried which task you want to use, so here's the link to the whole MSDN article. http://code.msdn.microsoft.com/windowsapps/WindowsPhone-Store-81-vs-25c80c2a
回答2:
From your Screenshot. I see your project is Windows Phone 8.1, not Windows Phone Silverlight 8.1
. Please see your Solution Explorer, is it Windows Phone 8.1? If so, there are not Microsoft.Phone.Tasks
namespace anymore. If you want to choose picture, you should use FileOpenPicker
.
来源:https://stackoverflow.com/questions/24997435/microsoft-phone-tasks-namespace-is-not-available