Wednesday, August 26, 2015

How to fix the Sharepoint Provider Host App deployment Issue after create a new branch on TFS (Team Foundation Server)

After I deploy the Sharepoint Provider App to the Production Server, then I branch out a new project on the current project for continuing development.

Howerver, i deploy the app to the Sharepoint Development Server, I try to access the item in document library. I always encounter this error

clientContext.ExecuteQuery(); Access denied. You do not have permission to perform this action or access this resource.

The cause of this issue is that App still use the previous clientID, which is reference to the Previous App Web.


We should generate a new Client ID for the new branch

use the new GUID to replace the clientId in appManifest.xml of Sharepoint App Project.

 <AppPrincipal>
    <RemoteWebApplication ClientId="9bb877e4-1c73-4258-8224-924c2e75a8f0" />
  </AppPrincipal>

replace the previous clientId with new Guid ID in the web.config File in the App Web Project.

  <add key="ClientId" value="9bb877e4-1c73-4258-8224-924c2e75a8f0" />


No comments:

Post a Comment