Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Brendan Rice 538 posts 1102 karma points
    Sep 21, 2010 @ 18:51
    Brendan Rice
    0

    Umbraco membership events not working

    I have 2 projects in the same solution as my Umbraco website BLL.dll and UI.dll (shortened names).

    I have the following class in my BLL project that looks like this:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using umbraco.cms.businesslogic.member;
    using umbraco.BusinessLogic;
    using umbraco.cms.businesslogic;
    using umbraco.cms.businesslogic.web;


    namespace MailChimp4Umbraco.Userinterface
    {
        public class UmbracoMembershipIntegration :  ApplicationBase
        {
            public UmbracoMembershipIntegration()
            {
                Member.BeforeSave += new Member.SaveEventHandler(Member_BeforeSave);
                Member.AfterSave += new Member.SaveEventHandler(Member_AfterSave);
            }

            public void Member_BeforeSave(Member sender, umbraco.cms.businesslogic.SaveEventArgs e)
            {
                throw new Exception("How can I debug this");
            }

            public void Member_AfterSave(Member sender, umbraco.cms.businesslogic.SaveEventArgs e)
            {
                var test = 1;
            }
        }
    }


     

    I have referenced the UI project in the website (as well as tried as post build event to copy the dlls) and put a breakpoints in the above constructor, then attached to the w3wp.exe process from VS to debug.

    My breakpoint never gets hit, the exception never gets thrown.  Can anyone help please?

     

     

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Sep 21, 2010 @ 20:51
    Lee Kelleher
    0

    Hi Brendan,

    Couple of things to check - sorry if they sound simple and/or you've already checked them.

    • Make sure that you have compiled in Debug mode - I know you say you have, but double-check.
    • Have you copied across the .pdb files with the .dll files?
    • Is the "compilation" section in your Web.config set "debug=true"?
    • Are you attaching to the correct worker-process, (w3wp.exe) ... if you have multiple IIS websites running, it can be confusing!

    Let us know if you make any progress.

    Cheers, Lee.

  • Brendan Rice 538 posts 1102 karma points
    Sep 22, 2010 @ 16:12
    Brendan Rice
    0

    This mysteriously started working, nothing changed since yesterday but I am now able to debug it, I am putting it down to gremlins.

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Sep 22, 2010 @ 16:43
    Lee Kelleher
    0

    Edit: Brendon edited the previous comment ... all working now - great!

Please Sign in or register to post replies

Write your reply to:

Draft