Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

changing feature name in visual studio 2008

Posted on 2008-06-11
5
Medium Priority
?
919 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 1500 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
When using a search centre, I'm going to show you how to configure Sharepoint's search to only return results from the current site collection. Very useful when using Office 365 with multiple site collections.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

972 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