Solved

changing feature name in visual studio 2008

Posted on 2008-06-11
5
885 Views
Last Modified: 2013-12-17
I have just started a new project using the web part template.  When deploying to Sharepoint I get an error message stating 'the feature name webpart1 already exists in sharepoint'.  I know that to change the feature name I've got to use WSPview and edit either the manifest or feature.xml, but how do I do it?
0
Comment
Question by:millerthegorilla
  • 3
5 Comments
 
LVL 6

Expert Comment

by:zell71
Comment Utility
head into:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES

and find the feature name (from here you can find the name of the feature and do a stsadm command to fully delete it) or rename it in the xml file...probably a IIS reboot will be required but i really would suggest using stsadm commands for removing/adding solutions
0
 

Author Comment

by:millerthegorilla
Comment Utility
You misunderstand - I don't want to remove the existing feature - I want to rename the feature in Visual Studio so that when it is deploying I won't get the same error message.  By default, all web part projects started using the installed web part template are named webpart1.  To know how to change the feature name is pretty important.
0
 
LVL 9

Accepted Solution

by:
moss_guru earned 500 total points
Comment Utility
The Feature's name is the "Title" attribute on the root <feature> tag in the Feature.xml file when you deploy the feature.  If it is already deployed, you have to retract it, remove the solution, then add the new solution with the renamed feature, then deploy it.
<?xml version="1.0" encoding="utf-8" ?>

<Feature Title="My Feature's Title"

ActivateOnDefault="TRUE"

    Description="My Cool Feature" 

    Scope="WebApplication"

    Id="B83ED45F-E2E9-4a5f-BD7F-582B737BE201"

	Hidden="FALSE" 

    xmlns="http://schemas.microsoft.com/sharepoint/"

	Version="1.0.0.0"

	ReceiverAssembly="MyFeature, Version=1.0.0.0, Culture=neutral,PublicKeyToken=f031662e9aa4295c"

	ReceiverClass="MyFeature.Worker"

	>

	<Properties>

		<Property Key="Text" Value="Hello World"/>

	</Properties>

</Feature>

Open in new window

0
 

Author Comment

by:millerthegorilla
Comment Utility
No that's not the answer.  I found the answer when I used the smarttemplate from codeplex.  
        //     Change the name of the WebPart1 class to a proper name.
        //      If you change the class name of this web part you also have to
        //      update the SiteViewV3.WebPart1.webpart file in the features folder.

where siteviewv3 is my project name.  Simple.
0
 

Author Comment

by:millerthegorilla
Comment Utility
You can also simply delete the folder 'webpart1' and then right click on the project in solution explorer and choose add new item and choose new webpart.
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Summary In SharePoint 2010 it is easy to create custom color themes to jazz up a site. Theme colors can also be created in PowerPoint 2010 with a few clicks. But how do the chosen colors actually look in the SharePoint site? The attached PowerPoint…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now