I had a similar problem while running tutorials on a linux, my conclusion back then was ...
App.Close(); destroys the openGL context, so in your main loop you first destroy openGL and then you start making openGL calls.
Ether break out of the while loop right after calling App.Close() or
work with a boolean to keep the loop active and move App.Close() to a nice spot after the while loop.
*cross fingers*