开发者

Sharepoint webpart deployment - activate features error

开发者 https://www.devze.com 2023-03-21 22:09 出处:网络
I\'m a noob to Sharepoint development, actually I hoped I\'d always be a noob to it, and I\'m having difficulty building my first web part for a Sharepoint 2010 website. I\'m using Visual Studio 2010,

I'm a noob to Sharepoint development, actually I hoped I'd always be a noob to it, and I'm having difficulty building my first web part for a Sharepoint 2010 website. I'm using Visual Studio 2010, and I started with a Visual Web Part. All i added was a simple asp:Label control, as I just want to make sure it's deploying correctly before I go any further. It builds, says it's deploys even, and then croaks on the 'activate feature' step. I get the following error.

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

There isn't much out there to go by for help on this. I made sure the scope of the feature was set to 'Site', as was recommended. I even tried changing the xml of Feature1.Template.xml to:

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

And the error persists. I read something about the web.config of the site might causing it, but it provided no explanation as to why. Any thoughts?

EDIT

There is my 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>

and my Feature1.Template.xml:

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

I haven't altered either one of them from what Visual Studio initially creates. I tried declaring the id & scope in Feature1.Template.xml, but i got the same error after.


kindly go through the following URL which has complete solution for your problem

http://blogs.msdn.com/b/sowmyancs/archive/2008/04/02/server-error-feature-guid-is-not-installed-in-this-farm-and-cannot-be-added-to-this-scope.aspx


It sounds like you have the incorrect scope set for your feature. Take a look here to see what features can be deployed at what scope.

Simplest way is just to weak that scope setting, redeploy and see if you get a better result :)


if you have farm admin privilages, you can goto the Central Admin -> System Settings -> Manage Farm Solutions Select Project.wsp file and click on Deploy Solution

Depending the feature scope setting, go there to activate it. For Example, if its site collection level, goto site collection settings and activate it.

Alternately you can also use powershell to do the same thing.

0

精彩评论

暂无评论...
验证码 换一张
取 消