Hello,
I am trying to render Line Chart on Windows Server 2003 environment which is my staging box. My chart is the aspx page which is in this folder D:\inetpub\wwwroot\bizcase30\rev\revcahrt.aspx. I also have ChartImages directory under rev folder.
This directory has Full Control on Network Service account and Full Control on ASPNET machine account. But yet when I try to render the graph I get the "A generic error occured in GDI+"My deployment scenario is File System. It is asking me to refer to KB article 5444.
The application bizcase30 runs part of a apppool. In the AppPool the property for Identity is set to Predefined - Network Service.
On my development box it renders properly since it is a XP box and the ASPNET machine account has fullcontrol on ChartImages folder.
Please help.
Thanks,
Finally I got it working. I deleted the application folder under wwwroot and the application from IIS. Recreated both, granted Network service Full Control access and it started working. Don't know what was wrong.
Anycase, thanks for your help.
at first i wondered why two of those came out blank, but when i tested this out in Server2003 i got the same result.
so i created a website on the server at http://localhost/website and c:\inetpub\wwwroot\WebSite.
then i created a subfolder called chartImages.
then I added this code to Page_Load:
System.Drawing.Font arial = new System.Drawing.Font("Arial", 12f, System.Drawing.FontStyle.Bold); System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(250, 250); System.Drawing.Graphics gfx = System.Drawing.Graphics.FromImage(bmp); gfx.Clear(System.Drawing.Color.White); gfx.DrawString("Hello World", arial, System.Drawing.Brushes.Black, System.Drawing.PointF.Empty); bmp.Save(@"c:\inetpub\wwwroot\WebSite\chartImages\test.png", System.Drawing.Imaging.ImageFormat.Png);
at first, it didn't work, so i went to windows explorer, right-clicked the chart images folder, and on the security tab i added "Network Service" with Full control.
when i ran it again, the image was created, no problem.
i'm running out of ideas as to why this doesn't work on your server...
Page.User.Identity.Name - Nothing (blank)
System.Security.Principal.WindowsIdentity.GetCurrent().Name - NT AUTHORITY\NETWORK SERVICE
System.Threading.Thread.CurrentPrincipal.Identity.Name - blank
to confirm that your web app is running under the Network Service identity, try evaluating these expressions at runtime:
Page.User.Identity.NameSystem.Security.Principal.WindowsIdentity.GetCurrent().NameSystem.Threading.Thread.CurrentPrincipal.Identity.Name
Yes. The Network Service identity has Full Control over the application and the ChartImages folder.