有关A generic error occurred in GDI+问题

原创 2013年12月05日 12:04:13

在开发项目的时候遇到这样一个问题:

程序在本机可以运行,然后放到服务器A也可以运行,可是放到服务器B上,就无法运行,报错如下:

A generic error occurred in GDI+.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
Stack Trace:


[ExternalException (0x80004005): A generic error occurred in GDI+.]
   System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams) +460940
   System.Drawing.Image.Save(String filename, ImageFormat format) +69
   FanG.Chartlet.SaveChart(String path, Bitmap chart) +190
   FanG.Chartlet.DrawBarsChart() +5670
   FanG.Chartlet.Render(HtmlTextWriter writer) +79
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +173
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +31
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +53
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2671

 

解决的办法就是对该文件夹进行权限处理,如果不知道是哪个用户在用它,那么就给所有用户最高权限

文件夹——属性——安全,选择用户名,授权

再次运行就可以了

希望能帮助遇到类似问题的朋友。 

 

解决A generic error occurred in GDI+的问题

转自VC错误:http://www.vcerror.com/?p=1759 问题描述: DNN Fck editor中的上传图片没有改变size的功能感觉很不方便,所以准备加一个改变图像siz...
  • swanabin
  • swanabin
  • 2015年07月18日 17:14
  • 2509

异常A generic error occurred in GDI+的解决办法

  • 2015年01月23日 18:58
  • 398KB
  • 下载

A generic error occurred in GDI+. 解决方法

使用image1.RotateFlip(RotateFlipType.Rotate90FlipNone)方法时候,出现错误: An unhandled exception of type 'Syst...
  • wletv
  • wletv
  • 2011年08月17日 11:22
  • 13628

异常A generic error occurred in GDI+的解决办法

WPF开发中,对图片进行操作时,有时会遇到这样的异常“A generic error occurred in GDI+”,结合我所遇到的情况,根本原因是当一个对象对图片文件进行操作时,例如只是读取图片...
  • u013376417
  • u013376417
  • 2015年01月23日 18:50
  • 1180

A generic error occurred in GDI+问题对应~

Bitmap.save(): A generic error occurred in GDI+ Try the following code You will get the above mentio...
  • gongth_12
  • gongth_12
  • 2014年09月20日 09:56
  • 1068

System.Drawing.Image.Save, A generic error occurred in GDI+.

When I using System.Drawing.Image.Save() to save an image, an exception occured, it says:A generic e...
  • xinbin1122
  • xinbin1122
  • 2009年06月02日 12:49
  • 2618

解决A generic error occurred in GDI+的问题

DNN Fck editor中的上传图片没有改变size的功能感觉很不方便,所以准备加一个改变图像size的功能。 因为不想改变UploadFile()这个DNN core method所以准备...
  • kingmax54212008
  • kingmax54212008
  • 2017年10月12日 15:52
  • 159

System.Runtime.InteropServices.COMException (0x80004005): 无法创建目录或文件

自定义工具错误: "代码生成器 'ReportCodeGenerator' 失败。异常堆积 = CrystalDecisions.Shared.CrystalReportsException: 加载报...
  • xiaozhao_19
  • xiaozhao_19
  • 2014年08月04日 12:50
  • 5901

有关A generic error occurred in GDI+问题

在开发项目的时候遇到这样一个问题: 程序在本机可以运行,然后放到服务器A也可以运行,可是放到服务器B上,就无法运行,报错如下: A generic error occurred in GDI+. ...
  • a1355943003
  • a1355943003
  • 2013年12月05日 12:04
  • 1602

使用Xcode7打包ipa文件出现提示错误

提示错误有2个: 1、An error occurred during export. 2、The file “xxx.ipa” couldn’t be opened because there ...
  • yuhao309
  • yuhao309
  • 2016年09月20日 08:57
  • 1496
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:有关A generic error occurred in GDI+问题
举报原因:
原因补充:

(最多只允许输入30个字)