Hi,
I am developing a simple auto hosted app.
It has following code in default.aspx.cs
var spContext = SharePointContextProvider.Current.GetSharePointContext(Context);
using (var clientContext = spContext.CreateUserClientContextForSPHost(
{ clientContext.Load(clientContext.Web, web => web.Title);
clientContext.ExecuteQuery();
Response.Write(clientContext.Web.Title);
}
}
In the above code it throws Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException exception for clientcontext object when executed. Has anyone seen this before and can help with pointers?
I am using O365 for publishing the app.
Thanks
-http://lrathi.blogspot.com