WEB Part deployment Question

May 6, 2008 at 9:09 PM
Hi
I am a new user and this is the first time using STSDEV. I am trying to deploy a web part using STSDEV. I Created a web part solution using the
"Web part solution(C# assembly)" And then generated the project. This template generates TWO web parts (CustomWebPart1 and CustomWebPart2).
However I require only one web part called ListDisplay. I deleted every this in the project that refers to CustomWebPart2 and renamed everything with
CustomWebPart1 by my name (ie ListDisplay). The contents of WebParts.xml and Feature.xml where thus modified.

When I install the package it seems to be ok. But If I try to deploy the solution this process is expecting CustomerWebPart2.
Error message is:
The element file 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Template\Features\CGI.SharePoint.ListDisplayWebPart\WebParts\CustomWebPart2.webpart' is missing from feature 'CGI.SharePoint.ListDisplayWebPart' (Id: f951899f-a692-45e3-8c63-76f0fb765421).

Can anybody inform me where the reference for CustomerWebPart2 can be found

Thanks in advance for any assistance
Guy
May 13, 2008 at 7:17 AM
Hi there,

I usually do the same thing whenever I create a new solution. To remove the CustomWebPart2 you need to do the following:
-remove the CustomWebPart2.cs file (in the root folder of your solution)
-go into RootFiles\Template\Features\<your solution name>\WebParts and delete the file CustomWebPart2.webpart
-go into RootFiles\Template\Features\<your solution name> ; Here you need to modify both the feature.xml and webparts.xml file to remove the reference nodes to CustomWebPart2.
From the webparts.xml you need to remove the following node: 

<

File Url="CustomWebPart2.webpart" Type="GhostableInLibrary"><Property Name="Group" Value="YOURSOLUTIONNAME" /></File>

 

 

and the feature.xml remove the node: <ElementFile Location="WebParts\CustomWebPart2.webpart" /> 

This should be all you need to do to remove the second webpart.
In a separate note, if you have changed the namespace or the class of CustomWebPart1 you also need to adjust the CustomWebPart1.webpart file accordingly.

Hope it helps!
Tudor