Bug in WebChart when IPv6

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
PTV
Newbie
Newbie
Posts: 3
Joined: Thu Aug 10, 2006 12:00 am

Bug in WebChart when IPv6

Post by PTV » Fri Nov 21, 2008 9:24 am

Hi,

I always get a System.NotSupportedException when I open a ASP site containing a WebChart (v2).
The TempChart property is set to File and the registry values "ShareFolder" and "VirtualShare" are OK .
When I start the web application in Visual Studio 2005 in debug mode everything works fine.
The folder settings (permissions to read and write) are correct, too.
Maybe the problem is my Vista 64x (IIS 7.0) in combination with the WebChart.
The exception is thrown before first WebCharts AfterDraw event is risen.
I have absolutly no idea what else I could try.... I spend 3 days with this issue.......

Thanks for your help !


The stacktrace:

[System.NotSupportedException: The given path's format is not supported.]
System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath) +127
System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath) +329
System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) +105
System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, AccessControlActions control, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath) +54
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +677
System.IO.FileStream..ctor(String path, FileMode mode) +64
Steema.TeeChart.Export.ImageExportFormat.Save(String FileName) +29
Steema.TeeChart.Web.WebChart.CreatePictureFile(HtmlTextWriter writer) +1426
Steema.TeeChart.Web.WebChart.Render(HtmlTextWriter output) +10
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +59
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +68
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +37
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
System.Web.UI.Page.Render(HtmlTextWriter writer) +26
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2558
Last edited by PTV on Fri Nov 21, 2008 2:04 pm, edited 4 times in total.

PTV
Newbie
Newbie
Posts: 3
Joined: Thu Aug 10, 2006 12:00 am

Post by PTV » Fri Nov 21, 2008 1:07 pm

I took a look at TeeChart source code (WebChart.cs, method CreatePictureFile)
The file name is build with this code:

string fileRoot = ID.ToString() + Context.Request.UserHostAddress.ToString().Replace(".", "")
+ timeStamp.Replace(",", "").Replace("/", "").Replace(":", "").Replace(" ", "").Replace(".", "");

In my case the fileRoot value is:
WebChart1::1633628717810557595

The UserHostAddresss = ::1 and this is what causes the error. A file name must not contain ':' chars.
::1 is the IPv6 address of localhost
I´m a little bit confused why IPv6 is not considered in WebChart, but happy to found the reason...

Is this bug resolved in TeeChart v3 ? I think it´s done in a few seconds ;-)

Greetings

Marc
Site Admin
Site Admin
Posts: 1266
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Mon Nov 24, 2008 10:15 am

Hello,

TeeChart Version 3 code is similar for version 3. We'll check behaviour.

Re.
string fileRoot = ID.ToString() + Context.Request.UserHostAddress.ToString().Replace(".", "")
+ timeStamp.Replace(",", "").Replace("/", "").Replace(":", "").Replace(" ", "").Replace(".", "");

In my case the fileRoot value is:
WebChart1::1633628717810557595


It's not clear at first glance from your description why "::" isn't being cleaned out by the parse line (.Replace(":", "")). If you do a view source of the final generated page, could you confirm to us please that the file name still contains the ":" character.

Regards,
Marc Meumann
Steema Support

PTV
Newbie
Newbie
Posts: 3
Joined: Thu Aug 10, 2006 12:00 am

Post by PTV » Mon Nov 24, 2008 11:08 am

Hello,

The "::"-chars are located in the UserHostAddress, and the code there does only clean out "." and not ":".
Look at Context.Request.UserHostAddress.ToString().Replace(".", "")
The parse line (.Replace(":", "")). is executed on timeStamp not the UserHostAddress.

See:
Context.Request.UserHostAddress.ToString().Replace(".", "")
+ timeStamp.Replace....


I changed the source code to:

Context.Request.UserHostAddress.ToString().Replace(".", "").Replace(":","") + timeStamp.Replace....

Now it works fine :D

Regards

Marc
Site Admin
Site Admin
Posts: 1266
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Tue Nov 25, 2008 8:35 am

Hello,

Re. (.Replace(":", "")). is executed on timeStamp not the UserHostAddress

Yes, thanks for pointing that out, I hadn't noticed that. We'll include your modification for future versions.

Regards,
Marc
Steema Support

Post Reply