Click here to Skip to main content
15,891,774 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey,
I am using direct show library to extract the thumbnail images from a wmv file.then I save those images to a thumbnails folder on the root directory. The problem is that when I run the app from Visual studio it executes perfectly. But when from IIS 6.0 .. it gives me the error "A generic error occurred in GDI+". :(

I have gone through many blogs and forums. tried almost 5-6 solutions including
--Checking write permissions on the folder
--disposing off the bitmap variable in order to lose the handle
--writing to memory stream then writing to file system

e.t.c
Please can any one help me out. I have been trying from yesterday.
Posted
Updated 6-Apr-11 0:47am

It might be a Release/Debug build issue (e.g. the debug build masks an error in your code) see, for instance, the Newcomer's assay: "Surviving the Release build"[^].
:-)
 
Share this answer
 
Comments
ahsan sarfraz 6-Apr-11 7:06am    
:s
Sergey Alexandrovich Kryukov 6-Apr-11 15:06pm    
This is only the issue when a code has bugs.
Also, we don't know yet: it can be due to VS application hosting regardless Release or Debug configuration. The point of my Answer is getting exception dump, please see.

--SA
You can show your code. Also, it is possible that you have an issue in both Release and Debug configurations when running our of Shell, not hosted by the VS. You need to check this. If you encounter problem only outside of VS, this is a bigger problem, as you cannot use Debugger You need to catch all exceptions in every thread and obtain complete exception dump. Usually it helps.

Use my instruction on how to do it:
How do i make a loop that will stop when a scrollbar reaches the bottom[^]
When i run an application an exception is caught how to handle this?[^]

Additionally, try to handle System.AppDomain.FirstChanceException and System.AppDomain.UnhandledException (credit to Espen Harlinn for the idea).

—SA
 
Share this answer
 
v3
Comments
Espen Harlinn 6-Apr-11 16:44pm    
Exception handling is always a good idea - 5ed!
Sergey Alexandrovich Kryukov 6-Apr-11 17:43pm    
Thank you, Espen. Another credit for the same idea!
--SA
Espen Harlinn 6-Apr-11 17:46pm    
Thanks you, SAKryukov!
Use Log4Net[^] or someting similar to save information about exceptions to a log file when executing under IIS. Make sure that you are not using any Windows Forms or WPF related stuff :)

Here is a small article showing how to work with graphics in asp.net ASP.NET Generating Images on the Fly[^]

Regards
Espen Harlinn
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 6-Apr-11 17:44pm    
Certainly a good idea, my 5.
--SA
Espen Harlinn 6-Apr-11 17:46pm    
Thank you, SAKryukov!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900