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.