How and Programmatically to find when the ASP.NET workflow and application domain started? but more general.
How to find out the start time for AppDomain?
I tried something like this:
private readonly static DateTime _appDomainStarted = DateTime.UtcNow; public static DateTime GetApplicationDomainStartedTimeUTC() { return _appDomainStarted; }
But a static file is created only after it was a link once at runtime, so it does not work.
Perhaps there is a way to ensure that this code runs automatically when the assembly loads?
source share