有关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

 

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

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

再次运行就可以了

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

 

相关文章推荐

Delphi7高级应用开发随书源码

  • 2003年04月30日 00:00
  • 676KB
  • 下载

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

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

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

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

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

Bitmap.save(): A generic error occurred in GDI+ Try the following code You will get the above mentio...

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

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

[总结]C#用于BMP图像显示的方法

以下代码片段皆用到如下代码,故提取出来放在前面,以免重复             MemoryStream ms = new MemoryStream(bmpImgBuf);         //b...

VC GDI+: error C2660: 'new' : function does not take 3 parameters

今天在用GDI+写程序时,有 bmp = new Bitmap(L"E:\\1.png"); 用VC6 SP6或VS2005编译错误为error C2660: 'new' : function ...

LockBits in GDI+

什么东西一旦追求起效率来最终还是要归到比较底层的操作,比如 GDI 中直接操作位图数据就要用 GetDIBits / SetDIBits(或者已经废弃的 GetBitmapBits / SetBitm...

MyEclipse内存溢出问题(an internal error occurred during building workspace)

今天MyEclipse导入了一个比较大的项目,出现了an internal error occurred during building workspace错误。 网上搜了一下,据说是内存溢出问题。...
  • kexinmei
  • kexinmei
  • 2012年01月10日 13:04
  • 31895
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:有关A generic error occurred in GDI+问题
举报原因:
原因补充:

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