The Weekly Source Code 50 – A little on “A generic error occurred in GDI+” and trouble generating images on with ASP.NET

February 18th, 20108:27 am @ Editor

0


I got a nice little Yellow Screen of Death (YSOD) error on some code running under IIS that worked fine when running on the VS Developer Web Server. The error was "A generic error occurred in GDI+" and you know that if an error is generic, it's sure in the heck not specific. My little application takes an overhead map that's stored in a local file, does some calculations from user input and draws an X on the map, then returns the resulting dynamically generated image. There's basically three ways to do images on the server side. Use Native APIs and Interop, which only works in full trust, use System.Drawing, which " isn't supported " or use WPF on the server side, which also, ahem, isn't officially supported…(read more)