I've just inherited a system that is 100K+ lines of C#/.NET code. Over the past few years, many of the functions of the system have been subsumed by other systems. The only reason we keep running this system is that it provides a small subset of IOT/sensor functionality. Basically, it is now only used to configure sensors and to receive sensor traffic and log it to a database. I want to identify the actively executing code so I can pull it out and move it to its own, standalone system. And then I want to retire the existing legacy system.
I have been able to step through the system in Visual Studio in dev, but there's no way for me to simulate all of the sensors, errors, and types of sensor messages that the system sees in production so I doubt I'm seeing all of the code being executed.
Is there any way I can toggle a runtime switch, add global code, etc., to the existing solution so that it exports the programs and function names that it is executing in production? I'd rather not touch every single program/function with new debug code, but I fear this might be the only way to get the information I want.
Any other ideas?
Thank you, Terry
(I've tried stepping through the code in Visual Studio and examining stack traces, but this doesn't allow me to ensure that I've seen all code that is being executed in production. I've looked into the Reflection classes, but am unclear if this is a path to doing what I want since I don't want to have to insert debug code into each function/program.)