将可视 Web 部件部署到 SharePoint 2013(激活功能)时出错 [英] Error deploying visual web part to SharePoint 2013 (Activate Features)

查看:60
本文介绍了将可视 Web 部件部署到 SharePoint 2013(激活功能)时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Visual Studio 2013 将一个简单的 Web 部件部署到 SharePoint 2013,但出现以下错误:

I'm trying to deploy a simple web part to SharePoint 2013 using Visual Studio 2013 and I am getting the following error:

部署步骤激活功能"中发生错误:带有 ID 的功能...."未安装在此服务器场中,无法添加到此服务器场范围.

Error occurred in deployment step 'Activate Features': Feature with Id '....' is not installed in this farm, and cannot be added to this scope.

花了很长时间试图找到解决方案.几个博客和论坛都在讨论它并提供不同的解决方案(没有一个对我有用).

Spent a long time trying to find a solution to this. Several blogs and forums talking about it and giving different solutions (none worked for me).

功能范围设置为站点,解决方案未设置为沙盒.

Feature scope is set to site, and solution is not set to sandbox.

如果我选择跳过激活的选项,则部署有效.但是当我转到站点设置并查看功能时,我找不到它.(我查看了网站功能和网站集功能).

Deployment works if I select the option to skip activation. But then when I go to Site settings and look at features I cannot find it. (I looked at both Site Features and Site Collection Features).

我尝试在几个不同的地方更改权限.我将用户设置为网站所有者和网站集管理员(尝试了主要和次要),但似乎没有任何区别.

I have tried to change permissions in several different places. I made the user the site owner as well as the site collection administrator (tried both primary and secondary), but it didn't seem to make a difference.

我是 SharePoint 整个复杂世界的新手,因此我缺乏确切的术语.在使用这个农场解决方案之前,我尝试使用沙箱,一切正常:我能够调试和部署.

I'm new to the whole complicated world of SharePoint, so bare with my lack of exact terms. Before going for this farm solution I tried with sandbox and everything worked fine: I was able to debug and deploy.

我知道有一种使用 PowerShell 进行部署的方法,但我认为这不是理想的解决方案.

I know there's a way to deploy using PowerShell but I don't think that's the ideal solution here.

有什么建议吗?谢谢!

推荐答案

如果您跳过激活,您应该通过脚本部署功能.

if you skip activation you should deploy feature by script.

部署 webpart 的步骤

Steps to deploy a webpart

1 - 在项目设置中转到 sharepoint 并为Active Deployment Configuration"选择No Activation"

1 - in the project settings go sharepoint and select "No Activation" for "Active Deployment Configuration"

2 - 部署项目

3 - 在管理外壳中运行以下代码(以管理员身份运行管理外壳)

3 - Run the code below in management shell (Run as administrator the management shell)

 install-spfeature "yourProjectName_FeatureName"           /*exp: TEST.Webparts_Feature1*/

4 - 停用 - 在网站集功能"中激活功能

4 - Deactivate - activate fature in "Site Collection Features"

这篇关于将可视 Web 部件部署到 SharePoint 2013(激活功能)时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆