写在前面
SharePoint Add-In = SharePoint App
中文: SharePoint加载项和SharePoint应用程序是一回事
所以看文章,找模板或找设置的时候要默念:SharePoint加载项和SharePoint应用程序tmd是一回事
加粗表示重要,欢迎入坑
满心欢喜用VS2013做了一个SharePoint2013 App Demo,F5一键运行却碰到一系列问题,随记录,与新手共享.
错误1
“未在此网站上启用应用程序的旁加载”,
解决办法:
进入SharePoint PowerShell :
Enable-SPFeature -Identity e374875e-06b6-11e0-b0fa-57f5dfd72085 -url <siteurl>
启用这个Feature 即可!
错误2
部署步骤“安装 SharePoint 应用程序”中出现错误: 系统帐户无法执行此操作。
"Error occurred in deployment step "Installed app for SharePoint": The System Account cannot perform this action"
So the solution is:
- Create a new account.
- Add this account to local admin.
- Then add the account to farm admin group. Open sharepoint central administration, go to Security. From there select Manage the farm administrators group.
- Now open visual studio into different user ( Shift + Right Click, and open with different user ). and put the user which you have created now.
我在虚机域控上开发的,所以角色直接搞域管理员.
用另外一个身份运行VS2013打开App项目时会要求提升权限,点击使用其他凭据重启即可
问题3
本地SharePoint服务器不可用。检查服务器是否正在运行并连接到SharePoint场。
"Error occurred in deployment step "Installed app for SharePoint": The local SharePoint server is not available. Check that the server is running and connected to the SharePoint Farm"
解决办法:新创建的账户要有sql server数据库的db_owner权限。记住每个数据库都要设置一遍。
问题4
错误 1 部署步骤“安装 SharePoint 应用程序”中出现错误: 只有网站管理员可以安装或卸载应用程序。
这个好解决:
进入SharePoint2013管理中心 -> 网站集 -> 更改网站集管理员
将新建的账户设为第二管理员即可.
问题5