Вопрос

I am following this article- http://chakkaradeep.com/index.php/building-apps-for-sharepoint-with-mvc/ to learn building Provider Hosted Apps in SharePoint. I have one developer site collection (I am the administer of the same).

I followed exact steps in the article but somehow I am always getting null value in var clientContext = spContext.CreateUserClientContextForSPAppWeb()

I tried giving full read write access to Site Collection as well as particular List I am trying to access. I know it doesn't have to do with the permissions of the application.

I get the context when I try var clientContext = spContext.CreateUserClientContextForSPHost()but not with var clientContext = spContext.CreateUserClientContextForSPAppWeb()

I am very new to SharePoint 2013 and Provider hosted apps. Hope someone will help me out..

Regards, RP

Это было полезно?

Решение

You need to have app web for that. In provider hosted app, app web is not present by default. Create an empty module or list in your app web; basically in SP project which gets created when you create a provider hosted app and then you will have context.

Besides that, why do you need context of app web of you don't have anything in there?

Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top