Defines methods that are called when a Feature is installed, uninstalled, activated, deactivated, or upgraded.

learn more… | top users | synonyms

1
vote
2answers
58 views

Difference between enabling feature from PowerShell and activating it via site collection features page?

I am trying to create a SharePoint list based on a list template via a feature. The code for creating the list is in the FeatureActivated event handler of the feature's EventReceiver.cs file. The list ...
0
votes
0answers
11 views

The right place to add / remove timer jobs [duplicate]

Still fairly new to SP. Have a question about adding timer jobs via features. A couple of weeks ago when I was even newer to SP, I followed one or two tutorials on the subject. The code in these used ...
2
votes
1answer
922 views

failed to create receiver object from assembly sharepoint 2010

I have created two features and I want both use same receever class so I created a class MyFeatureReceiver (some where in project SP/MyRecievers/) which implements SPFeatureReceiver and has a ...
1
vote
2answers
70 views

How to retract unretractable solution

Looks like I made a pretty big mistake when doing some testing with a sample sharepoint project. Ironically, I was trying to spike up a unit testable solution, without writing many of the tests first. ...
1
vote
3answers
1k views

Error while activating custom feature

I have a wsp package installed as farm solution. package has event reciever on activating feature. When I go to Site Collection Features and activate this feature i get an error Error File ...
2
votes
1answer
46 views

Add Publishing Pages to specfic subsites programmatically in FeatureReceiver

Currently, I have created subsites programmatically in FeatureReceiver method and have a way to create publishing pages, but they are being created on the root site. Is there a way to target a ...
1
vote
0answers
11 views

How to get SPFeatureDefinition for Generic List in sandboxed solution

When creating custom list programatically from schema Add method needs SPFeatureDefinition object of the base list used. SPListCollection.Add method (String, String, String, String, Int32, String, ...
0
votes
1answer
1k views

Problem with save conflict when adding content type to list

I have a feature receiver with the following code: public override void FeatureActivated(SPFeatureReceiverProperties properties) { SPSite site = (SPSite)properties.Feature.Parent; ...
1
vote
3answers
2k views

Powershell Deployment - Enable-SPFeature Error

I get the following problem activating a feature in powershell: Enable-SPFeature : The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: ...
0
votes
1answer
28 views

Site provision cycle

I have some site definitions in which I have added multiple lists into the <Lists> tag and then I've added a stapling feature which will trigger a series of web-scoped features when sites are ...
2
votes
1answer
37 views

Deleting lists upon feature deactivation

I have a FeatureReceiver class for a feature that deploy a couple of list instances. In the FeatureDeactivating event I want to remove those instances as well as other artifacts which get deployed ...
3
votes
2answers
110 views

updating CustomMasterUrl of rootweb and subweb

I've created a web template and as part of the provisioning process I set the SPWeb.CustomMasterUrl. I do this in code. When I create a site collection using this template it works fine but if I try ...
5
votes
3answers
5k views

FeatureActivated event receiver giving access denied when trying so set WebApplication property

When a Site event feature is activated I am trying to set some properties on the web application. My feature uses this value. public override void FeatureActivated(SPFeatureReceiverProperties ...
1
vote
0answers
45 views

FeatureActivated() not binding two SPEventReceiverDefinitions

I have a feature which I have placed in the onet.xml in to make it active whenever the site collection is created. The feature contains two event receiver definitions for permission groups. One is for ...
0
votes
1answer
99 views

Deployment Issue with Custom FIeld Types

SHORT DESCRIPTION Custom Field Types are not being correctly deployed/activated on all but one Virtual Machine. I have several VMs with identical SharePoint environments. I have a Visual Studio ...
2
votes
2answers
773 views

Preventing alerts from being sent when programmatically updating list item

I have a feature receiver which batch updates a particular field / column in my list. Code is provided below. NB: This is very simple list item batch processing code which I got from ...
2
votes
1answer
62 views

Deleted Feature Receiver is Still Running

Here is a complicated one I have been banging my head against for months. I have a SharePoint 2010 site feature with a custom navigation provider. I have created a feature receiver that will add the ...
5
votes
5answers
14k views

Error occurred in deployment step 'Activate Features': <nativehr>0x80070002</nativehr><nativestack></nativestack>

I have a feature. On the FeatureActivated event I am creating a list if it is not there. I also have an EventReceiver that in the elements.xml on the Receivers node has the attribute ListUrl. This is ...
2
votes
2answers
5k views

Failed to load reciever assembly

I have issue during deployment. It throws: Failed to load reciever assembly I tried to GAC that assembly, also microsoft.office.sharepoint.clientextensions.dll and Microsoft.Office.Server.dll ...
1
vote
1answer
2k views

Programmatically set homepage in Sharepoint Foundation

I need to set the homepage to default.aspx in my FeatureActivated event receiver. I tried rootWeb.RootFolder.WelcomePage = "default.aspx"; rootWeb.RootFolder.Update(); but that doesn't seem to be ...
0
votes
1answer
42 views

Developing a custom NewForm

I have created a custom layout in _layours/PhoneBook/createform.aspx and then wrote the following code to run upon activation: private void newAddFormForMembers(SPWeb web) { SPList ...
0
votes
1answer
93 views

Documents list not exsists when activating feature

I have created a custom web template based on Team Site and added a spweb scoped feature to add a list view web part to it. It throws an exception when it comes to web.Lists["Documents"] and says ...
0
votes
2answers
79 views

Feature Receiver fires before Layouts content is copied

I have a package with some Application Pages (in Layouts Folder) and a Feature which contains some WebParts. I tought the Layouts contents are copied first to SharePoint, then the WebParts from the ...
2
votes
4answers
3k views

SP2010 Reset all subsites to inherit masterpage using c#

I'm creating a site feature reciever which sets a custom master page on the root web. I would also like the master page set on the root to be inherit to all the subsites. What is the most elegant way ...
0
votes
2answers
301 views

Failed to load receiver assembly, missing service recycle?

I'm activating a feature using PowerShell and every "once in a while" it fails with the error "Failed to load receiver assembly". It seems to be complaining because some service or application is ...
0
votes
1answer
108 views

Execute SPFeatureReceiver only on site creation

We have recently upgraded from SharePoint 2007 to 2010 and we aren't yet ready to train users on the new interface, so I've created a SPFeatureReceiver that will set the site template back to the 2007 ...
1
vote
1answer
2k views

Delete page from the Site Pages library

Wondering if someone has the code to delete a page from the Site Pages library in a Feature Event Receiver on de-activation TIA
0
votes
2answers
132 views

Add web service to sharepoint as feature item

I have a web service and a custom logging service class. The logging class has a feature that update or remove itself according to the feature events (Activated=SPService.Update, ...
2
votes
3answers
1k views

SPWebConfigModification class will not update Central Admin application's web.config file

Using SharePoint 2010 I am trying to use the SPWebConfigModification class to make some basic changes to web.config files on applications in the farm, including the Central Administration web.config ...
1
vote
1answer
144 views

Add an <assembly> to web.config with SPWebConfigModification

I am trying to add an assembly to configuration/system.web/compilation/assemblies - but with the following code it I get Expression must evaluate to a node-set. private SPWebConfigModification ...
0
votes
2answers
133 views

How to test if page layout is in use

I have created a module with a few files that I update & delete via spfeature. Thing is if a page layout is in use I cannot delete it and it throws an error, even when inside a try{ }catch{} . How ...
2
votes
1answer
258 views

SPListCollection.EnsureSitePagesLibrary() throwing SPException (specified title already exists in this Web site)

I am attempting to call SPListCollection.EnsureSitePagesLibrary() upon FeatureActivated. The method is throwing the following exception: Microsoft.SharePoint.SPException: A list, survey, ...
0
votes
2answers
106 views

Changing the SharePoint Home Page doesn't work until I click on site Title

I am installing a sub-site in Sharepoint 2010 using PowerShell. For all the sub-sites, we have configured sharepoint to launch a particular sub-site's default.aspx page as landing page after log-in. ...
0
votes
1answer
60 views

Remove a list from all site collections when a feature is uninstalled

I have a site scoped Feature which specifies a list as such: <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> ...
0
votes
1answer
600 views

Error while creating Event Receiver

This is Sample of my Code SPList list = new SPSite(siteURL).OpenWeb().Lists[listName]; SPEventReceiverDefinitionCollection eventReceivers = list.EventReceivers; SPEventReceiverDefinition ...
1
vote
1answer
379 views

Feature Activated Event not triggered when creating a new sub site with web template

When I create a new site I have a Web Scoped FeatureActivated event that I would like to run. The feature does get Activated but the FeatureActivated event is not triggered. The site is created with ...
0
votes
1answer
93 views

Add custom code for solution upgrade

I have a solution for SP2010. Let's call it s.wsp. I had version 1 of s.wsp and now I have version 2 of s.wsp. Versions 1 and 2 share three common features: A, B and C. Version 2 adds a new feature D. ...
2
votes
1answer
834 views

Event Receivers not added when installing wsp

I have a set of event receivers for a SharePoint 2010 content type and Library. Previously, these would install and automatically be activated when I ran a script to install the wsp solution. I dug ...
0
votes
3answers
753 views

Get deployed .aspx page in feature receiver to add WebPart

I have a SharePoint solution which deploys an aspx page in a custom folder in the Layouts folder. I need to get this page in the Feature Event Receiver so I can add to it a WebPart. In the ...
1
vote
2answers
119 views

SPWebConfigModification class not found?

Using Sharepoint 2010, I am trying to use the SPWebConfigModification class to add connection strings the the sharepoint's web.config. My problem is that the class SPWebConfigModification is not ...
2
votes
1answer
257 views

Perform a blob cache flush in a feature event receiver

I have a site collection scoped feature that should provision a css file to the "Style Library" of a site collection. The feature also performs cleanup of the file in the deactivation receiver. I ...
0
votes
1answer
394 views

Unable to create Sub web Programmatically in Feature Receiver

I have write code in Feature Receiver to Create SubSite but while Feature is activating it returns the error http://pc31:2000 contains illegal character ':'. This is My Code where I got Error. ...
0
votes
1answer
165 views

Error adding feature receiver

I have added a feature receiver code file to a web template in visual studio. When i deploy it i get the following error. If i delete the feature receiver it works fine. I have tried cleaning the ...
0
votes
2answers
95 views

How do i create a feature in web template?

I have created a web template in visual studio, it includes the standard element file and onet file, it also has a feature which is scoped to site level. All this works fine, i can deploy it and can ...
0
votes
1answer
43 views

Sharepoint Feature Creation Approach

I want to create a feature, once the feature is activated by the administrator a number of lists, items and workflows will be created. What would be the best approach to implementing this? The ...
1
vote
1answer
408 views

Get current user in SPFeatureReceiver?

I am working on a web application-scoped feature which creates a site collection. I would like to set the person who activated the feature as site collection owner. To do that, I would have to either: ...
0
votes
1answer
176 views

Object reference not set on Feature Receiver in a Stapled feature

SharePoint 2010 question. My 1st goal is to add some custom themes to site collections when they're created. I have this working with a simple 2 feature stapling solution (Themes.Feature, ...
0
votes
0answers
192 views

FeatureActivated is not firing after activating feature in code-behind

I've a strange problem with activating a feature from C#: I have a list with a event receiver attached, which creates a new sub-site every time a new listitem has been added: var newWeb = ...
1
vote
2answers
116 views

SPDispose check gives error

SPDispose gives error Disposable type not disposed Microsoft.SharePoint.SPSite ***This may be a false positive depending on how the type was created or if it is disposed outside the current scope ...
0
votes
1answer
207 views

Custom Site Content type is not getting mapped for the required taxonomy field

I have a custom project site template which is coded in c#.net VS 2010, I have deployed the projects related to the project site template into central admin through VS After deploying the solution I ...