The feature-receiver tag has no wiki summary.
6
votes
3answers
2k views
How do you “stop” activating a feature within the feature receiver?
I have a feature receiver with some long running code, hence I use SPLongOperation and delegate for better visual appearance. Basically my feature receiver looks like so:
public override void ...
5
votes
2answers
725 views
Can't deploy Admin Approved Form Template using XSNFeatureReceiver in SharePoint 2010
I am trying to deploy an Administrator Approved InfoPath form template to SharePoint 2010 as a feature. I've done this lots of times in 2007 and never had an issue - but this will not play ball.
I ...
5
votes
1answer
126 views
How to handle web references becoming stale in a web feature activation
We have a number of web-scoped features all stapled to a site definition, so they are all activated in turn when a web is created from the definition.
It seems the feature receivers all share the ...
4
votes
3answers
4k views
Best method to create custom NewForm / EditForm
I am new to sharepoint development and need to create some custom NewForm/EditForms for a new custom list I am creating. It seems like I have two choices:
...
4
votes
4answers
651 views
Web Template - Receivers Not Firing
I have a custom web template used to provision site collections that activates features with onet.xml and is deployed as a farm solution. I've tried both feature receivers and event receivers (on ...
3
votes
3answers
3k 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 ...
3
votes
2answers
195 views
Feature Activation Logic (Prevent Activation)
I have three site collection features used to set branding throughout the site collection. I want to prevent the accidental activation of one of the features if one of the three is already activated; ...
3
votes
4answers
7k 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 ...
3
votes
1answer
281 views
Is SPFeatureCollection.Add method asynchronous?
I have a quite complex application that is split into several features.
In order to hide this complexity, I set the IsHidden property of the feature to true, then have created a "master" feature. ...
3
votes
2answers
237 views
Error on feature activated property creation
Im trying to create custom properties on feature activated event, but it doenst work, does anyone has any suggestion, what the problem could be?
When i do a console application and try there my code ...
2
votes
2answers
100 views
How to catch the feature activate time
I am trying to write one program such that, when ever a feature is activated then it should display the activated time in the sharepoint list. for that i written following code.
public class ...
2
votes
4answers
2k 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 ...
2
votes
1answer
173 views
Will feature receiver get activate if user has no permissions to a site?
Here's what I need...User does not have access to a site (http://myserver/sites/MySite). When user tries to access they are redirected to ugly AccessDenied.aspx.
I was researching and found that ...
2
votes
2answers
598 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
2answers
452 views
Why do I get a security validation invalid error updating a field from a feature receiver?
Trying to change the title field of a document library to be required..doesn't want to work.
SPList docLib = web.Lists["Process Aids"];
SPField field = docLib.Fields["Title"];
field.Title = "Display ...
2
votes
1answer
108 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, ...
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 ...
2
votes
1answer
414 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 ...
2
votes
1answer
632 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 ...
2
votes
1answer
388 views
Deploying webparts to default.aspx with a SiteDefinition feature dependency
I tried deploying a Site Definition with a custom default.aspx page.
Within the <WebFeatures> node of the Site Definition's Onet.xml I tried to reference a Feature which would get a web part ...
1
vote
1answer
128 views
How to rename a file in the 14 hive - edited-
I need to rename the user.aspx file in the 14 hive layouts directory in a feature event receiver. Is this possible ...if so...how?
OK - Bad idea....This is what i want to do: I have a custom ...
1
vote
2answers
2k views
The breakpoint will not currently be hit - debuging feature receiver
I need to debug my feature receiver, so I set up few breakpoints, but when I hit F5 in VS2010, they are all missed, and it says that "The breakpoint will not currently be hit. No symbols have been ...
1
vote
2answers
250 views
Visual Studio 2010 Workflows not associating with list
Probably a silly question: I have a vs2010 project with workflows in a site scoped feature. When i deploy through visual studio the workflows are associated with lists. However when i deploy ...
1
vote
2answers
112 views
Backup a file while custom feature activated?
We have a custom application page "custom.aspx" on the Layout folder, would like to rename the original file "custom.aspx" to "custom_bak.aspx" before the updated/modified custom application page ...
1
vote
2answers
68 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 ...
1
vote
1answer
193 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:
...
1
vote
2answers
3k views
Failed to load reciever assembly
me again =) ... 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 ...
1
vote
1answer
951 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
1
vote
1answer
36 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 ...
1
vote
1answer
172 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 ...
1
vote
1answer
101 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 ...
1
vote
2answers
94 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 ...
1
vote
1answer
379 views
ContenTypes on List Definition not added
I've an ListDefinition with some references to existing Content Types (provided by CTH) but when the list is created the content types are not added.
elements.xml
<Elements ...
1
vote
1answer
276 views
How Do I Rename a List Instance's Field's StaticName in FeatureUpdating?
I am creating a custom WSP in Visual Studio. This solution has several custom content types with custom fields as well as a list instance with content types enabled. Unfortunately, i need to change ...
1
vote
1answer
463 views
removing a sharepoint solution duplicates entry in web.config?
My intentions is to be able to add and remove web.config changes when a solution is installed or uninstalled.
The code below and the powershell below works ALMOST as expected.
When I add sp ...
1
vote
2answers
1k 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: ...
1
vote
1answer
94 views
Disable Web-scoped features on Web deletion
I have a SPWeb ( http://example.com/site ), created used a custom web template, with several features activated on its scope.
When I delete the SPWeb it would be desirable that all the features ...
1
vote
1answer
2k views
Deleting Site Columns and Content Types Programmatically
I have a feature that adds two site columns to a content type on activation. On deactivation it's supposed to delete them, but I'm getting the following error:
"Site columns which are included in ...
1
vote
1answer
538 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 ...
1
vote
2answers
680 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 ...
0
votes
2answers
127 views
How can I pass an argument to a FeatureReceiver during solution setup?
I have this Sharepoint 2010 solution containing 3 projects:
Class Library with Model classes
Class Library with LINQ to SQL data context
Sharepoint 2010 project
WCF REST service
3 Visual web parts
...
0
votes
1answer
233 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 ...
0
votes
1answer
79 views
Problem activating feature on child webs
I have a feature that is manually activated. In a feature receiver I also activate the feature on any child SPWebs in existence. I would like some code to run only on the SPWeb where the feature is ...
0
votes
3answers
632 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 ...
0
votes
1answer
486 views
Cannot set the associated group from a feature receiver
In a feature receiver, I want to create group and set the associated owner group of the Web.
This feature is activated automatically from a custom site template (I think this the root of the problem).
...
0
votes
2answers
30 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
25 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 ...
0
votes
2answers
53 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 ...
0
votes
1answer
146 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
397 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 ...


