A generic error occurred in GDI+

后端 未结 10 647
孤城傲影
孤城傲影 2020-12-17 18:17
[ExternalException (0x80004005): A generic error occurred in GDI+.]
   IpitchitImageHandler.Data.ImageRepository.AddNewTempImage(Stream image, String extension, Guid         


        
10条回答
  •  攒了一身酷
    2020-12-17 18:43

    I hate that error with a passion. Generic Error is possibly the most useless error description ever written.

    When I've encountered it the problem as always been related to file IO.

    Here is the list of fixes I keep in my notes- Not sure if these apply but they usually do the trick for me.

    • Check File path
      • Make sure that the parent directory exists
      • Ensure that path includes both the filename and extension
      • Use server.MapPath() to create the path
    • Make sure that the file isn't being written back to it's source. Close and reopen the stream if necessary.

    My apologies if i stole this list from somewhere else. It has been in my notebook for awhile and I can't remember where it came from.

提交回复
热议问题