Quantcast
Channel: Developing Apps for SharePoint 2013 forum
Viewing all articles
Browse latest Browse all 8089

Autohosted App throws exception while accessing Host Web

$
0
0

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


Viewing all articles
Browse latest Browse all 8089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>