Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have created an event receiver (on item adding) using VS2010 in SharePoint 2010 targeted to specific custom list which is a globally deployed in the production environment.

This event receiver works fine in the development machine but in the production environment the functionality is not working. Any suggestions?

share|improve this question
    
Have you used a program like SharePoint Manager 2010 to verify that the event receiver has been added to the list instance in question? –  Jason Rastovski Jan 20 '12 at 18:06
    
you've turned on the feature, right? –  ironman99 Jan 20 '12 at 19:33

2 Answers 2

up vote 2 down vote accepted

The first thing you may want to make sure is event receiver was attached to the list. Following is a powershell script which can help you enumerate the list of event receivers:

$webUrl = Read-Host "Provide web url:"
$listUrl = Read-Host "Provide List url:"
$web = Get-SPWeb $webUrl
$listUrl = $webUrl + $listUrl
$list = $web.GetList($listUrl)
Write-Host "Following are event receivers registered for the list"
foreach ($receiver in $list.EventReceivers)
{
    $msg = [String]::Format("Name:{0}, Assembly:{1}, Class:{2}",$receiver.Name, $receiver.Assembly, $receiver.Class);
    Write-Host $msg
}

If you see your event receiver listed there, make sure assembly and class names are correct and assembly is deployed.

You may want to keep a watch on ULS logs as you update the item and look for error.

Usually, I write code in event receiver to log verbose messages ULS so that I know what's going on.

share|improve this answer

Can't get SharePoint Manager to work for the life of me. Why should we have to depend on 3rd party products to do our jobs? This is microsoft software after all!

I have a similar situation in that I've developed a package with two lists with 'on item added' event receivers. I import csv files to the lists via powershell and on my development server the event recievers work adding taxonomy terms from the imported list items. In production it doesn't work when importing. But, if I manually enter a list item to the lists the event receivers do work and the entry gets added to the relevant taxonomy term - so why not the import?

share|improve this answer
    
Peter, SharePoint Manager is just a really nice tool you can use to help debug; any product is going to have gaps (especially Microsoft's!). :) For the second part, can you please post a new question with the powershell script and a link back to this question? It sounds like a separate issue. –  Kit Menke Feb 24 '12 at 15:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.