Running VS and SharePoint on the same server, but I am unable to debug my simple Event Receiver
to see why it is not firing.
Here is the snipp:
public class EventReceiver1 : SPListEventReceiver
{
/// <summary>
/// A list was added.
/// </summary>
public override void ListAdded(SPListEventProperties properties)
{
base.ListAdded(properties);
TestReceiver(properties.WebUrl, properties.ListId);
}
protected TestReceiver(string webUrl, Guid listGuid)
{
using(SPSite site = new SPSite(webUrl))
{
using(SPWeb web = site.OpenWeb())
{
SPList list = web.Lists[listGuid];
list.Description = "Test";
list.Update();
}
}
}
}
Solution deploys successfully, but going back to the UI and adding a list, description is not updated as seen in the TestReceiver()
method. Attempting to attach VS to all w3wp
process does not load any breakpoints either. What gives?
EDIT
I have also confirmed via Powershell, that the document library does have my Event Receiver
attached to it.
try-catch
to reach out and log to a DB, but nothing has been logged and the description of the list is never updated.