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

learn more… | top users | synonyms

3
votes
1answer
1k views

failed to create receiver object from assembly

I have created two features and I want both use same receiver class so I created a class MyFeatureReceiver (somewhere in project SP/MyRecievers/) which implements SPFeatureReceiver and has an ...
0
votes
0answers
18 views

Feature Stapler not working

I have created some branding for the SharePoint 2013 MySites with a feature stapler so that it can also add the branding to the Blog, Apps and Tasks but it's not working. The branding applies to the ...
0
votes
1answer
19 views

Feature Activation User

Which user context is used in feature activation receiver? Is it current user (when activating from WebUI)? I have to call a service in feature activation receiver and I have to know which user ...
0
votes
0answers
12 views

Web Application level feature is reactivated during re installation of solution

I have Web Application level feature and its getting reactivated during deployment. Below are my feature properties, Activate On Defult: True Always Force Install: False whatever the value I have ...
1
vote
1answer
37 views

Programatically identifing feature for activation

I have a requirement where a custom action is only added to the root site of the site collection. So planning to add two features one Site scoped and the other Web scoped. In the event receiver of a ...
1
vote
1answer
28 views

Accessing termstore in Feature Receiver throws UnauthorizedAccessException

Im trying to run the code below but I get a UnauthorizedAccessException at the last line(using SP 2013) TaxonomySession newTaxonomySession = new TaxonomySession(site); var termStore = ...
1
vote
2answers
1k views

how to remove a published content type from subscribed site collections

I have a small Visual Studio 2010 project with one farm level feature that I deploy to a site collection which is configured as my content type hub. The FeatureActivated event adds a site column and ...
0
votes
0answers
20 views

How to add color to calender in programatically using event receiver?

When ever an item is added into the calender using event receiver 2012. It need to check category column values based on selecting category color should change in sharepoint2013. Example:-If ...
1
vote
1answer
39 views

Feature Event Receiver not picking up latest code until second activation

I have a Feature with an event receiver (written in c#), which for the sake of brevity creates a list which is a data store for a form on a custom web part. I have ps1 scripts which retract and deploy ...
0
votes
1answer
23 views

When uploaded file from an external program, ItemAdded is not fired

I have an event receiver which works/triggered when I manually add document by click 'Add document', but the same in not working/triggered when an external application is uploading the document. For ...
1
vote
1answer
88 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 ...
1
vote
1answer
44 views

is It safe to use feature activated method to create new site column which is used then by content type

We have a content type vs project. The content type is adding a field ref. This field ref is a new site column created using same project but as an empty element. This works. I am wondering whether ...
7
votes
4answers
20k 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
981 views

Error occurred in deployment step 'Activate Features': Object reference not set to an instance of an object: feature receiver error

I cretaed a Visual web part in SP 2013. It needs a SharePoint list. So wrote below code in web part feature receiver. When I deploy the solution I get error says Error occurred in deployment step ...
0
votes
2answers
107 views

Object reference not set to an instance of an object on feature deployment- Can't deploy even

I am writing code for feature activated code. But when I try to deploy my solution through VS 2010 it says deploy failed Error on feature activation : object reference not set to an instance of an ...
0
votes
2answers
76 views

Feature removal without deactivation

My project had a feature, and on activation of this feature, I was binding an event receiver to a list; on deactivation, the event receiver was removed. It so happened that this feature was activated ...
1
vote
4answers
2k 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 ...
3
votes
1answer
3k 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 ...
2
votes
4answers
4k 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
1answer
57 views

Feature activation terminated if code is running too long (SP 2010)

Is it possible that feature activation will fail or will end unexpectedly (without any exceptions in ULS) when it takes too long for code to finish the job? We have a feature which during activation ...
0
votes
1answer
90 views

Unable to see timer job

I have created a custom timer job, which contains a feature. I have successfully activated the feature on my web application, but it does not show up under the job definitions. Feature.xml is as ...
0
votes
1answer
58 views

Activating web feature from event receiver doesn't do anything

I have the following code that should run to automatically disable the Minimal Download Strategy feature when a new site is being provisioned. Unfortunately nothing happens. No errors are captured in ...
2
votes
1answer
81 views

Programmatically setting HtmlDesignAssociated value

I'm deploying a composed look from the server (including the .spcolor, .spfont, master.html and master.preview files), but I cannot get the field Associated File to select. I've tried setting it in ...
1
vote
1answer
72 views

Feature stapling always returns item does not exist: it may have been deleted by another user

I'm attempting to create a feature stapled solution that pushes out custom branding to every new site collection created. The following code is in my event receiver: public override void ...
2
votes
2answers
637 views

Unable to Delete Custom Master Page Programmatically During Feature Deactivation 2013

I currently have a custom master page that is being deployed at the Site scope. Once deployed and the feature is activated it makes the master page available for use. I am able to activate the ...
2
votes
2answers
437 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 ...
1
vote
2answers
103 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. ...
2
votes
1answer
180 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
48 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
2k 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
31 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
82 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
410 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
7k 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
1answer
213 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
852 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
89 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 ...
3
votes
2answers
7k 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 ...
0
votes
1answer
53 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
169 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
119 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 ...
0
votes
2answers
704 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
145 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
176 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
209 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
179 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 ...