I have a C# RichTextBox Control in Windows forms that is not visible when built in Release mode. If I run in Debug mode and use the debugger, then the RichTextBox is visible. I am very sure that it is not the code that is setting the RichTextBox as not visible. If that was the case, then the result should be the same in both Debug and Release. I have no conditional code that differs between Release or Debug, thus this can not be affecting this.
Also, when the application is loading after being built in Release mode and run by double clicking the file, it takes a very long time before (up to more then a minute) before the application is started and visible. When the application is run via Visual Studio in Debug mode, it starts instantly and the RichTextBox Control is visible.
I have been trying to solve this some time now, but have not found any solution. I also tried using Process Monitor
to see if there were files that were not loading, but did not find any.
I created a Windows Server 2012 VM and copied the Release compiled exe and dlls over there. When running the application in this VM, it started smoothly and the RichTextBox Control was visible. I myself am running Windows 7, so I tried creating a blank Windows 7 virtual machine and installed .Net 4 Client profile on it. Then checked what would happen when I started the application in there, with same error result(RichTextBox Control not showing and taking a long time to load).
Any ideas to solve this?