locked
Still struggling with debugging RRS feed

  • Question

  • The developer of the application has left...

    Seems like a minor thing, but the code is emailing the developer that left, and the user is complaining about it, as getting bouncebacks.

    Absolutely hate C#Sharp, its awful.

    Anyway, I can see these lines of code:

    public SNATLookup(IDbConnection databaseConnection, ILogger loggerInstance,
    string localDirectory, string unknownPrlEmailAddress,  string senderEmailAddress, string prlEmailAddressOverride, IPrlMaterialDataHelper prlMaterialDataHelper, ITeradataHelper teradataHelper)
     :

    base(databaseConnection)
            {
                _logger = loggerInstance;
                _localDirectory = localDirectory;
                _emailAddressesForUnknownPrl = unknownPrlEmailAddress;
                _senderEmailAddress = senderEmailAddress;
                _prlEmailAddressOverride = prlEmailAddressOverride;
                _localPrlFileDirectory = Path.Combine(_localDirectory,
    "PRL Data Files");

                _prlMaterialDataHelper = prlMaterialDataHelper;
                _snatRoot = GetConfigItems(ConfigItem.ConfigTpes.Prl).Single(x=>x.ConfigKey.Equals(ConfigItem.ConfigKeys.Root)).ConfigValue.ToString();
                _teradataHelper = teradataHelper;
            }

    I CAN SEE:

      _prlEmailAddressOverride = prlEmailAddressOverride;

    Getting SET in the Debugger (to the developers email address).

    e.g. I have a "watch" on it and can see it set!

    But maddeningly, I can't see "HOW" it gets set.

    It just appears by magic. I presume either he's hidden his email address in the database somewhere, or it's in some kind of configuration file or something. Any ideas how I can see how "_PrlEmailAddressOverride" is set????

    Monday, April 1, 2019 3:31 PM

Answers

  •   _prlEmailAddressOverride = prlEmailAddressOverride;
    Getting SET in the Debugger (to the developers email address).
    e.g. I have a "watch" on it and can see it set!
    But maddeningly, I can't see "HOW" it gets set.

    Put a breakpoint on that line of code so that execution stops there, then check the call stack - the string is being passed in from
    whatever is calling that function.

    Dave

    Monday, April 1, 2019 6:34 PM

All replies

  •   _prlEmailAddressOverride = prlEmailAddressOverride;
    Getting SET in the Debugger (to the developers email address).
    e.g. I have a "watch" on it and can see it set!
    But maddeningly, I can't see "HOW" it gets set.

    Put a breakpoint on that line of code so that execution stops there, then check the call stack - the string is being passed in from
    whatever is calling that function.

    Dave

    Monday, April 1, 2019 6:34 PM
  • In the callstack is more nonsense:

    > ToxOpt.Base.dll!ToxOpt.Base.Classes.SNAT.SNATLookup.SNATLookup(System.Data.IDbConnection databaseConnection, ToxOpt.Base.Interfaces.ILogger loggerInstance, string localDirectory, string unknownPrlEmailAddress, string senderEmailAddress, string prlEmailAddressOverride, ToxOpt.Base.Interfaces.IPrlMaterialDataHelper prlMaterialDataHelper, ToxOpt.Base.Interfaces.ITeradataHelper teradataHelper) Line 43 C#

    It seems like the parameter is somehow set when the application starts perhaps? As my code although it *Seems* to set it, in the watch window the parameter is somehow already set.

    Wednesday, April 3, 2019 1:58 PM
  • >It seems like the parameter is somehow set when the application starts perhaps?

    Possibly some infrastructure code is reading it - but I'm only guessing.

    The usual way of working out what's going on is to use the call stack window to go to the caller site and work backwards through the
    code.

    Dave

    Wednesday, April 3, 2019 3:20 PM