There are no static fields initialized before calling SetupDates() , there is something else in your code that is not visible from the code really provided.
For example, I see an ad:
private void SetupDates(int n)
but also
private static readonly DateTime[] dates = SetupDates(20 * 12);
EDIT
If SetupDates() intializaes is a static field, as in the provided code (but I am not repeating the code as it is), you should pay attention to the order of initialization. In that case may occur when SetupDates() is called before start intialized.
The function returns nothing, it is impossible even to compile it.
source share