I have a class, which has a default constructor inherently.
public class OneRollingFileAppender : RollingFileAppender
{
#region RollingFileAppender Overrides
protected override void Append(LoggingEvent loggingEvent)
{
GlobalFactory<ILoggingEventParameterManager>.Instance.Apply(loggingEvent);
base.Append(loggingEvent);
}
#endregion
}
Without editing the code, e.g adding a new constructor or property, how can I breakpoint default constructor?
NOTE: There should be a technique which will to find the code in IL or in memory, and then I'd like to set a breakpoint there.
Use WinDbg + SOS Extension
Attach to the process with Windbg (File/Attach to process)
load sos (.loadby sos mscorwks)
Set the breakpoint ( !bpmd mylib.dll Namespace.ClassName..ctor )
If you just want to know when the class is created you can make use of a function breakpoint within Visual Studio. Debug -> New Breakpoint
As Function name you enter your class name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With