C# console app throws System.TypeInitializationException at Program..cctor() at Program.Main(String args)
I have a console .NET application, let's call it MyProject, which runs scheduled using Windows Task Scheduler. I've noticed a command window that shows the following output in the black cmd window:
Unhandled Exception: System.TypeInitializationException: The type initializer for
'MyProject.Program' threw an exception. ---> System.NullReferenceException: Object
reference not set to an instance of an object.