Solved

changing feature name in visual studio 2008

Posted on 2008-06-11
5
899 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
ID: 21761368
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
ID: 21761547
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
ID: 21762226
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
ID: 21762453
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
ID: 21792333
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SharePoint 2010 Foundation Gatherer 10 66
Handle KeyDown for ToolStripDropDownButton, ToolStripMenuItem 3 26
Masterpage unexpected error 7 24
Search an image for an image 3 28
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

785 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