Monday, April 13, 2015

How to setup a provider-hosted app for sharepoint 2013 running under local IIS

when we develop a provider-hosted app for sharepoint 2013 with visual studio 2013, we did not need to make any configuration on the sharepoint host site and configuration file in the project. we can simply click start button to debug the provider-hosted app project.

If the provider-hosted app is under specific application pool, in order to use the specific service account to access the database.


Step 1. we must configure the project to run under Local IIS.

Right click on the Web Project, the select Property from the Pop Menu to show the project property window as following.



Step 2. Register the App part for sharepoint in the development environment or farm, use the following link
http://<SharePointWebsite>/_layouts/15/AppRegNew.aspx.



right click on the AppManifest file, then select View Code to open the file in the visual studio, and get the client ID from the section AppPrincipal Section.

 <AppPrincipal>
    <RemoteWebApplication ClientId="da0b46be-1349-4429-a96c-e2410120b1c2" />
  </AppPrincipal>


App Domain: should be your  Full Computer Name in the System Windows.

Redirect URI: http://AppDomain/YourProviderHostedAppWeb/ 

then click on the Create button to register the App in the development environment.

please visit the Register by using AppRegNew.aspx section for detail explanation in the link below.

https://msdn.microsoft.com/en-us/library/office/jj687469.aspx

here is the summary of the succeed registration.



Now, we can press F5 to start the project and debug it. 

Warming: you must register the app again, if you close the project.

Tips: since the app is executed under specific application pool with credential being setup for the
service account. we must check the Show Processes from all users check box to show W3P.exe process












 







No comments:

Post a Comment