The most prominent feature of SharePoint 2013 when compared to its predecessor SharePoint 2010 is the app model of development. In app model, there is the flexibility of creating and designing pages where one can define the functionality in the .NET language which will behave similar to any other .NET application during development. There will be an app project as well as a web application project. The web application contains the aspx pages , scripts, styles etc for the app to function which is similar to any other web application where as app project will contain the configurations for app. And yes, you can use client side code instead of C#. But as a .NET programmer I prefer the .NET coding for that.
You will be defining the far and wide of your page based on your requirements. If you are familiar with the web application model of .NET, you won half the battle. You could define the hierarchy of folders and pages in your application without any constraints imposed by SharePoint. Once the functionality is finished and tested, the app can be added to the app catalog and the web application can be published to a hosting environment.
It behaves similar to any other app where one can install it when he needs it and uninstall it completely when he does not need it any longer.
Here I would like to deal with some of the issues which I have faced during the development of my very first app model project in SharePoint 2013 and the solutions to those problems. I hope they would be helpful for the beginners in trouble.
Most of the issues are due to the lack of necessary privileges in the SharePoint Databases for the user account which is being used to create and run the application.
Error occurred in deployment step ‘Install app for SharePoint’: The System Account cannot perform this action.
You cannot use the System Account to create and run the application. For that another account is required. Create a new account under the domain and give admin privileges.
SharePoint Addin The local SharePoint server is not available. Check that the server is running and connected to the SharePoint farm
Give owner permission to the SharePoint database for the user account from SQL as follows:
From the SQL Server Management Studio
Security -> Login sub menu -> User Account-> Properties-> User Mapping-> select your SharePoint database and give owner permission to the account
Refer the steps described below if you are not aware of how to give permission.
Cannot connect to the SharePoint site:
Make sure that this is a valid URL and the SharePoint site is running on the local computer.
If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project
Give owner permission to the SharePoint database WWS_COntent and AppMng_Service_DB
‘Install SharePoint Add-in’: We’re sorry, we weren’t able to complete the operation, please try again in a few minutes. If you see this message repeatedly, contact your administrator.
Give owner permission to databases start with ‘AppMng_Service_DB_’ and ‘App_Management_’ for the user account.
After deployment you may get the following errors:
Web page not available:
Check the certificate path and the name is correct. Confirm that the extension “.pfx” is there for the certificate in the web.config of the deployed site.
HTTP 401.2 -Unauthorized: Logon Failed Due to Server Configuration with No Authentication
To resolve this problem, enable at least one authentication method. To do this, follow these steps:
From the Start menu, point to Programs, point to Administrative Tools, and then click Internet Services Manager.
Under the Tree pane, browse to the desired Web site.
Right-click the Web site, and then click Properties.
On the Directory Security tab, under Anonymous access and authentication control, click Edit.
Select (and implement) at least one type of authentication method.
Authentication failed/ 403 error
Update the changed client Id in the web.config file of the web application as in VS and app.
Thanks for reading! Happy coding!