How to correctly register a custom logger in an IDE's BuildEngine?


  • Hi again,

         In my endless search for a solution, I'm trying yet another method, but I'm still running into a wall.  I am trying to register my own logger class into my solution's build engine.  I get the instance of the engine like so:
    this.m_engine = Microsoft.Build.BuildEngine.Engine.GlobalEngine;
    and then on the OnBuildBegin event, I try to register my custom logger as follows:
    if (this.m_engine != null)

    This calls my logger's Initialize() function correctly, and just before the OnBuildDone event fires, my logger is Shutdown().  However, my logger's hooks into the IEventSource (to capture the errorraised and warningrased events) don't seem to be firing in between.

    I'm using the IDE to build the testing solution.  Are my troubles because I'm not getting the correct engine?  Or is it because the IDE doesn't call MSBuild?  I was told that the IDE used MSBuild underneath.  If this isn't the case, is there any way for me to hook into these events?


    Tuesday, January 30, 2007 10:00 PM

All replies

  • Hello,

    I am not too sure about it, but my guess would be that VS spawn separate build engine for each build; and I do not think that you could plug into that logic.

    Would be very interested to know if you could extend the VS build engine in some way.

    Regards, Eugene

    Sunday, February 18, 2007 6:32 AM