Showing posts with label Event Receiver. Show all posts
Showing posts with label Event Receiver. Show all posts

Saturday, 27 May 2017

Custom EventReceiver Feature not appearing in manage feature list

Recently while deploying event receiver on one of the web application i faced a strange issue. My solution file got deployed successfully, but the feature was not visible in "Manage Site Features" of the site for which I have to activate the event receiver.

The web application was migrated from 2010 to 2013.

The web results returned from google search was not resolving my issue.

Since it was not available in "Manage Site Features" I tried to activate using powershell, using below command:
Enable-SPFeature -identity  -URL yoursiteURL
The command failed with error
The feature is not a Farm Level feature and is not found in a Site level defined by the Url [Site Collection Url].

Then google search for this error message, return the actual cause for the issue. While migrating site from 2010 to 2013, we have not done the visual upgrade of the site. And because of this the feature was not available in "Manage Feature List"

So the solution was to install wsp file with compatibility level.
Install-SPSolution -Identity "Solution.wsp"  GACDeployment -CompatibilityLevel{14,15}

This resolved the issue, and feature appeared in Manage Site Features. Hope this helps.!!!!!

Friday, 3 July 2015

When to use BeforeProperties, AfterProperties, properties.ListItem in event receiver

Below table give us the idea on when to use BeforeProperties, AfterProperties, properties.ListItem in event receiver

Library
BeforeProperties
AfterProperties
properties.ListItem
ItemAdding
No value
No value
Null
ItemAdded
No value
No value
New value
ItemUpdating
Original value
Changed value
Original value
ItemUpdated
Original value
Changed value
Changed value
ItemDeleting
No value
No value
Original value
ItemDeleted
No value
No value
Null

Hope this helps!!!
Related Posts Plugin for WordPress, Blogger...