0

I have a SharePoint 2010 server and a development pc. I installed Visual Studio 2010 in my pc, and I created a web part. After I build the project I got the CreateTaskWebPart.wsp and CreateTaskWebPart.dll.

I deployed that solution using powershell. I executed the following commands to deploy my solution.

add-SPSolution c:\temp\solution1\CreateTaskWebPart.wsp install-SpSolution -Identity CreateTaskWebPart.wsp -WebApplication

http://moss2010:81/SitePages -GACDeployment

I went to Central Administration-> System Settings -> Manage Farm solutions. And I see that the web part was deployed to http://moss2010:81.

When I try to use that web part, I cannot see the the custom folder under Categories. So I am not able to use the webpart.


Edit:

Sorry for the delay. I am sending the elements, feature and manifest

This is the Elements.xml

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

This is the Feature.xml

<?xml version="1.0" encoding="utf-8"?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/" Description="My Visual WebPart Feature" Id="98d7ec0c-ba7c-4803-b722-e02e5507624c" Scope="Site" Title="CreateTaskWebPart Feature1">
  <ElementManifests>
    <ElementManifest Location="VisualWebPart1\Elements.xml" />
    <ElementFile Location="VisualWebPart1\VisualWebPart1.webpart" />
  </ElementManifests>
</Feature>

This is the manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<Solution xmlns="http://schemas.microsoft.com/sharepoint/" SolutionId="65eddfe5-1611-4c2e-970d-f6b3784d570e" SharePointProductVersion="14.0">
  <Assemblies>
    <Assembly Location="CreateTaskWebPart.dll" DeploymentTarget="GlobalAssemblyCache">
      <SafeControls>
        <SafeControl Assembly="CreateTaskWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=eca34ed344b67602" Namespace="CreateTaskWebPart.VisualWebPart1" TypeName="*" />
      </SafeControls>
    </Assembly>
  </Assemblies>
  <TemplateFiles>
    <TemplateFile Location="CONTROLTEMPLATES\CreateTaskWebPart\VisualWebPart1\VisualWebPart1UserControl.ascx" />
  </TemplateFiles>
  <FeatureManifests>
    <FeatureManifest Location="CreateTaskWebPart_Feature1\Feature.xml" />
  </FeatureManifests>
</Solution>

Thanks for your help

1
  • Please paste the Elements.xml from your web part folder in the Visual Studio solution.
    – James Love
    Aug 3, 2011 at 18:57

4 Answers 4

1

If you packaged it up as a feature then you probably need to enable the feature.

Go to Site Actions > Site Settings > Site collection features and make sure the feature associated with your webpart is Activated.

You could also activate it via PowerShell:

Enable-SPFeature –identity "CreateTaskWebPart" -URL http://moss2010:81
3
  • Hi Rob, Thanks for trying to help me. After I typed your sentence, I got an error "Enable-SPFeature : The Feature is not a Farm Level Feature and is not found..." I would like to say that I am following a very simple example found online. Most of the job is done by Visual Studio 2010. The only problem is the deployment. I am not allowed to install Visual Studio in the SharePoint Server. So I deployed manually. Do you think that I need to change something in the sharepoint setting to see webparts created? I am not sure if I have to use the sentral admin to fix my problem. Aug 3, 2011 at 20:11
  • 1
    Could you share the .WSP file? Would allow us to look at the manifest and feature XML and probably quickly pinpoint the problem. The 1st approach I mentioned to activate the feature was not Central Admin, it was the Site Settings...so if you're in the site trying to add the web part you can just go to the upper-left-hand corner, click Site Actions, then Site Settings, and then Site collection features ...if it deployed correctly you should see a feature for your web part in the list...Activate it.
    – Rob D'Oria
    Aug 3, 2011 at 20:21
  • OK, try the Enable-SPFeature command again but instead of "CreateTaskWebPart" use "CreateTaskWebPart Feature1"...i.e. the Title attribute on the Feature node in your Feature.xml file.
    – Rob D'Oria
    Aug 4, 2011 at 17:18
0

Also, if you update the solution and do not see the changes that are expected try deactivating/re-activating the feature.

0

Adding as an answer since I don't have enough rep to comment yet...

Rob D'Oria's answer is mostly correct. What worked for me would be something similiar to:

    Enable-SPFeature –identity "CreateTaskWebPart_Feature1" -URL http://moss2010:81 

You have to include an underscore for it to work properly. So if your feature "Title" attribute is "CreateTaskWebPart Feature1" then the identity you provide with Enable_SPFeature should be "CreateTaskWebPart_Feature1".

0

I think that there is need to enable the site collection feature associated with web part, To do this you need site collection admin privillage and perform following Goto site setting->Under site collection administration click on site collection feature ->Find your webpart name and enable the feature.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.