Sharepoint webpart部署 - 激活功能错误

时间:2011-07-20 12:50:15

标签: sharepoint powershell sharepoint-2010

我是Sharepoint开发的小伙子,实际上我希望我永远都是它的菜鸟,而且我在为Sharepoint 2010网站构建我的第一个Web部件时遇到了困难。我正在使用Visual Studio 2010,我开始使用Visual Web Part。我添加的只是一个简单的asp:Label控件,因为我只是想确保它在我进一步发展之前正确部署。它构建,说它甚至部署,然后在'激活功能'步骤呱呱叫。我收到以下错误。

Error   1   Error occurred in deployment step 'Activate Features': Feature with Id '12765e82-6e4a-4407-aa8c-77b537841f4b' is not installed in this farm, and cannot be added to this scope. 0   0   scCodePart

没有太多可以帮助的事情。我确保将该功能的范围设置为“站点”,如建议的那样。我甚至尝试将Feature1.Template.xml的xml更改为:

<?xml version="1.0" encoding="utf-8" ?>
<Feature Id="12765e82-6e4a-4407-aa8c-77b537841f4b" Scope="Site" xmlns="http://schemas.microsoft.com/sharepoint/">
</Feature>

错误仍然存​​在。我读了一些关于网站的web.config可能会导致它,但它没有提供解释为什么。有什么想法吗?

修改

有我的Elements.xml:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
  <Module Name="scClosetCodesVWP" List="113" Url="_catalogs/wp">
    <File Path="scClosetCodesVWP\scClosetCodesVWP.webpart" Url="scClosetCodesVWP.webpart" Type="GhostableInLibrary" >
      <Property Name="Group" Value="Custom" />
    </File>
  </Module>
</Elements>

和我的Feature1.Template.xml:

<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/">
</Feature>

我没有根据Visual Studio最初创建的内容更改其中任何一个。我试着宣布id&amp;在Feature1.Template.xml中的范围,但我在。

后得到了同样的错误

3 个答案:

答案 0 :(得分:2)

答案 1 :(得分:0)

听起来您的功能范围设置不正确。看看here,看看哪些功能可以在什么范围内部署。

最简单的方法就是弱化范围设置,重新部署并查看是否获得更好的结果:)

答案 2 :(得分:0)

如果您有农场管理员权限,则可以转到中央管理员 - &gt;系统设置 - &gt;管理农场解决方案 选择Project.wsp文件,然后单击Deploy Solution

根据功能范围设置,去那里激活它。 例如,如果是网站集级别,请转到网站集设置并激活它。

或者你也可以使用powershell做同样的事情。