I encountered this error when attempting to start a project's exe file compiled under the Release configuration.
Analysis & Observations
The exe file compiled under the Debug configuration started without any problem and there were no error messages or exceptions.
Starting the Release version from Visual Studio (though F5 - start debugging), it worked fine as well.
The Main() function had the Application.SetCompatibleTextRenderingDefault method call in the second line before the Load method call. So, this should be working fine.
The application configuration file has been renamed deployed.
When starting the exe, the process shows for a second in the Task Manager and then disappears (which is not what I expected).
There is no pragma code or conditional compilation sections in the code that may not execute when running in Release Mode.
After all these observations and some further investigation in the code, I have finally found the real problem. The MainFormController is a singleton and had a Form as an instance member. This form was being instantiated when the class was being loaded in the memory, well before the Application.SetCompatibleTextRenderingDefault and Load method calls.
I have changed the code to lazy initialization of the form, and thus, the form will be instantiated only when it is requested for the first time. Wohoooooo.