Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All.

I am developing a window 8 metro app where i have to use the ExchaneWebServices to create tasks and display all tasks back into my app. I used the following code.


public MainPage()
{

service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
service.Credentials = new WebCredentials(userEmail, userPassword);

service.AutodiscoverUrl(userEmail, RedirectionUrlValidationCallback);

FindAllTasks();

}

static void FindAlltasks()
{
//Create the extended property definition.
ExtendedPropertyDefinition taskCompleteProp = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Task, 0x0000811C, MapiPropertyType.Boolean);
//Create the search filter.
SearchFilter.IsEqualTo filter = new SearchFilter.IsEqualTo(taskCompleteProp, false);
//Get the tasks.
FindItemsResults<item> tasks = service.FindItems(WellKnownFolderName.Tasks, filter, new ItemView(50));
}

i am getting the error on last line of MainPage() when creating project in visual studio 2012 and windows 8

is it to do something with Exchange webservice 1.2 or 2.0 dll?because the same code work in a console application built in vs2010

Your valuable suggestions are welcome. Plz help.
Posted
Updated 9-Apr-13 21:49pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900