0

我一直在为 Mono/Android 评估 TeeChart,但每次我尝试运行示例项目时,我的模拟器都会抛出异常:

System.FormatException: String was not recognized as a valid DateTime.
 at System.DateTime.Parse  (string,System.IFormatProvider,System.Globalization.DateTimeStyles) [0x00027] in /Users  /builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/mono/mcs/class/corlib/System/DateTime.cs:830

 at System.DateTime.Parse (string,System.IFormatProvider) [0x00000] in /Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/mono/mcs/class/corlib/System/DateTime.cs:818

 at System.DateTime.Parse (string) [0x00000] in /Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/mono/mcs/class/corlib/System/DateTime.cs:813

 at Steema.TeeChart.Chart.BetaNotExpired () <IL 0x0000c, 0x000cf>

 at Steema.TeeChart.Chart.InternalDraw (Android.Graphics.Canvas) <IL 0x00001, 0x0004b>

 at Steema.TeeChart.TChart.Draw (Android.Graphics.Canvas,System.Drawing.Rectangle) <IL 0x000c4, 0x004ef>

 at Steema.TeeChart.TChart.Draw (Android.Graphics.Canvas) <IL 0x00007, 0x00097>

 at Steema.TeeChart.TChart.OnDraw (Android.Graphics.Canvas) <IL 0x00055, 0x001a3>

 at Android.Views.View.n_OnDraw_Landroid_graphics_Canvas_ (intptr,intptr,intptr) [0x00010] in /Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/monodroid/src/Mono.Android/platforms/android-12/src/generated/Android.Views.View.cs:9297

 at (wrapper dynamic-method) object.69af4743-db01-4501-8f13-77deb4a4e86e (intptr,intptr,intptr) <IL 0x00012, 0x00033>

根据堆栈跟踪,我猜它与 BetaNotExpired 以及可能的查找值有关,但我今天刚刚请求并收到了评估版本。有谁知道如何让 TeeChart 工作?

4

1 回答 1

0

对不起这是我的错。此测试版将于 7 月 31 日到期。我忘了使用文化中立机制。我使用了DateTime.Parse("31/07/2012")而您可能需要DateTime.Parse("07/31/2012")DateTime.Parse("2012/07/31")。因此,我更改了 TeeChart.Monodroid.dll 以使用文化中立机制将 DateTime 值转换为使用DateTime.ToUniversalTime()的通用时间。您可以在此处下载新程序集。它是用Mono for Android 4.2.3 beta编译的。如有必要,我也可以为 4.2 编译它。如果错误修复不能解决您的问题,请告诉我。

提前致谢。

于 2012-06-12T08:13:59.697 回答