This blog is useful in setting up your own Sharepoint development environment on local server.
I am assuming that you have already installed Sharepoint 2013 into your development server and now you want to start development for Sharepoint.
Small brief on Sharepoint app before we start setting up the development environment.
We can create 2 kinds of Sharepoint apps in Sharepoint 2013.
Sharepoint hosted app : In this app, components are hosted on Sharepoint farm.
Provider hosted app : In this app, components are deployed and hosted outside the Sharepoint farm. To avoid confusion in coming steps, I want to tell you that when it comes to app development, Provider hosted app is divided into two sub-types. One is Provider-hosted app and second is Autohosted app. (Difference between two is explained below.)
Now I will explain how to develop provider hosted app using Visual Studio 2013
Create Sharepoint App in Visual Studio :
Go to : File->New Project->office/Sharepoint->Apps->App for Sharepoint 2013
Provide the Sharepoint site URL from where you want to Debug Your App, you can consider this as a parent sharepoint site under which your app will be called.
Now you need to choose which kind of app you want to build. It gives you 3 options:
a) Provider-hosted : Choose this app when you want to host your app outside the Sharepoint farm and you want liberty to choose any technology in building your application and not only .NET.
b) Autohosted app : Choose this app when you want to host your app outside the Sharepoint farm and your application will only be built in .NET. You can deploy only Autohosted app onto Azure and not the Provider-hosted app.
c) Sharepoint-hosted app : Choose this app when you want to host your app within Sharepoint farm. In this app you will only work on client side of the application using, HTML and Client Side Object Model. There will be code which will run on the server.
Following steps are for Provider-hosted app
Select Web project type : Select either MVC or Web Forms application. This will be your main application which will be hosted within Sharepoint site but deployed on different server.
Configure authenticate settings : You need to provide certificate which you will use for your application authentication. You can assign the certificate at this stage or at later stage as well.
Now you will see that two projects are created with default templates.
- First (SharepointApp1) is your App for Sharepoint
- Second (SharepointApp1Web) is the main application where you will do your development.
Create your site in IIS : Create a folder where you will published your site from Visual Studio. Give this site the physical path to this published folder. Now, you will publish your site to this folder after every change you make in the application.
Create server certificate for high trust app :
You can refer http://msdn.microsoft.com/en-us/library/fp179901.aspx for steps to create server certificate.
Once, the certificate is created provide its detail in your application's web.config for ClientSigningCertificatePath, ClientSigningCertificatePassword and IssuerId.
Next is to register your app in Sharepoint
- Go to /_layouts/15/appregnew.aspx
- Generate App id
- Generate App secret
- Give your App a title
- Provide the App domain & redirect URI (IIS app)
*Note the App id and App secret for future use.
Update web.config : Provide the App id and App secret that was generated in the above step to ClientId and ClientSecret respectively.
Enable basic authentication : Go to IIS->Your site->Authentication. This is required to bypass authentication required on every subsequent hit to the application.
Open AppManifest.xml in Visual Studio and make changes for two sections:
- Under General settings, provide Start page of your app and in Query string section, make sure it has value as {StandardToken}.
- Under Permissions tab provide the Scope and Permission to your app for various section/features provided by Sharepoint.
Make changes to your application and publish it. You are ready to see your application running under Sharepoint. You need to publish your site every time you make any change in your app.
You development environment is setup for developing high-trusted Sharepoint App.
0 Comment(s)