Wednesday, February 13, 2013

Parameter is not valid - System.Drawing.Image.FromStream

Two cases when you get this error:
1. When the stream is of 0 length or null
2. When the stream you are trying to save as image is not actually an image, like for eg: I have the stream of a pdf file received from a service and I am trying to convert this to an image.

 

Tuesday, February 5, 2013

System.Net.WebException: The request failed with HTTP status 403: Forbidden.

I found a web service failing with this error on the prod box.

I found following is the issue that caused this
Execute permission on the virtual directory of the service is set to none, where it should be set to 'ScriptsOnly'.
I set this back to 'ScriptsOnly' and the service started working
I do not need to do an iisreset