iis - Strange image generation error in asp.net -
i have asp.net-mvc project need dynamically generate png images. that's easy. create actionresult returns filesreamresult object. generate images used classes system.drawing such bitmap , image. works fine on local machine , on production server. when iis on production server shuts down application pool due inactivity , starts again, image generation starts fail.
problem in code tries save image stream:
var imagestream = new memorystream(); bmp.save(imagestream, imageformat.png);
exception is: system.runtime.interopservices.externalexception (0x80004005): generic error occurred in gdi+. there no help. tried different solutions , nothing helps. after have found topic alternatives system.drawing use asp.net?
the main idea of topic is:
classes within system.drawing namespace not supported use within windows or asp.net service. attempting use these classes within 1 of these application types may produce unexpected problems, such diminished service performance , run-time exceptions.
so decided use wpf classes generate images. rewrote image generation code, error after app pool restart. exception: system.runtime.interopservices.comexception (0x88982f8a): exception hresult: 0x88982f8a. happens when try save pngbitmapencoder stream
var stream = new memorystream(); encoder.save(stream);
maybe encountered problem or have ideas?
here's unsatisfactory answer...
i getting same error when first deployed new image generation functionality.
i stopped corresponding application pool, restarted again, , worked.
Comments
Post a Comment