I wrote some code to do some things before and after an item is added to some lists. The solution is sandboxed.

I have checked and confirmed, through PowerShell, that the event receivers are bound to those lists. I have also double checked, to make sure those were the right receivers - the names are correct, and retracting the solution does remove the receivers from the lists. Redeploying and activating the feature redoes the binding.

I have all the permissions required (double checked, and triple checked).

The receivers are marked in elements.xml as synchronous, so they should be executed as soon as a user tries to add an item, and then as soon as the item is added, right? So just to make sure again, in the first line of the receiver methods I'm adding some text to Windows Event Log. I checked the log and there's nothing there. There's also nothing in the SP logs.

I have tried every solution in every thread in this site, and also some others. I have recreated the lists. I have bound them to the receivers through code instead of XML. I have disabled auto-activation of my features. I have reset IIS.

When I tried debugging, Visual Studio says the breakpoints will not be hit due to missing symbols. Again, I tried every solution in the Internet. I'm attaching to w3wp.exe, SPUCWorkerprocess.exe and owstimer.exe. Copying the .pdb files to the GAC, disabling the Just my code option in VS etc. Checking the modules during debugging, I see that the assembling containing the event receivers is never loaded, even after adding items to the lists they're bound.

I tried running some examples from some official training material, and they don't work either.

Event receivers for features, on the other hand, work just as expected, and I can debug them just fine.

I'm really out of ideas right now. Help?

Edit: as it turns out, logging was turned off. After turning it back on, we see error messages saying the assembly containing the event receivers could not be found in the GAC. This is to be expected, actually. I just wish this information was more clear - it took some digging and some luck to find that link.

We are now seeing how we can solve this. Tomorrow we're going to install the DLL's in the GAC. Working or not, I'll be back to post more details.

Edit again: so I added the DLL's to the GAC manually. Now the event fires. I still can't debug it, though (again, trying everything already mentioned above). So I'm getting errors in my code, and so far the only way to know what's happening is to insert something in the event logs every other line.

Last edit: I got it to work. Attaching Visual Studio to itself makes the debug symbols load. So the problem is finally solved.

  • Sandboxed and event log? Sandboxed solutions cannot write entries to the Windows Event log or the Unified Logging Service (ULS) trace log, nor can they create or retrieve diagnostic areas or categories. Commented Apr 10, 2013 at 20:10
  • Apparently they can, even without elevating priviledges. At least in the environment we're using.
    – Geeky Guy
    Commented Apr 15, 2013 at 12:54
  • Then you haven't deployed it as a Sandbox solution. You can deploy a "sandbox solution" as a farm solution, but not the other way around (well you can if you don't use restricted code in it) :) Its nothing in the .wsp that says its sandboxed. Commented Apr 16, 2013 at 13:04
  • Now that you've mentioned it, it all makes sense, and I'll look into it. Thanks :)
    – Geeky Guy
    Commented Apr 16, 2013 at 20:57

1 Answer 1


the first thing that comes to my mide is have you attached the event reciver to the list?

$spWeb = Get-SPWeb -Identity http://web.spdev.local
$spList = $spWeb.Lists["My List Name"]
$spEventReceiver = $spList.EventReceivers.Add()
$spEventReceiver.Assembly = "Project.Name.Class, Version=, Culture=neutral, PublicKeyToken=24242342424"$spEventReceiver.Class = "Namespace.MyClass.ClassName"
$spEventReceiver.Name = "My Event Name"
$spEventReceiver.Type = 10002
$spEventReceiver.SequenceNumber = 1000
$spEventReceiver.Synchronization = 1


if you have / after you have and it still doesnt attach to w3wp.exe you can recycle the app pool ;) in iis manager! find the web application that your using and what app pool its using and recycle it, now goto vs and attach to process!

  • Done that already. The receiver is still not firing.
    – Geeky Guy
    Commented Apr 10, 2013 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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