[Mono-list] TypeConverter cannot convert from System.String in 2.0 preview 1
Ivan N. Zlatev
contact at i-nz.net
Mon Aug 4 10:59:11 EDT 2008
On Mon, Aug 4, 2008 at 5:08 PM, Andrus <kobruleht2 at hot.ee> wrote:
> My WinForms application does not start with 2.0 preview 1. Exception is
> below.
If it runs on MS.NET but doesn't run on mono then it's a bug of ours.
Can you please make a *small* self-contained test case out of your
application by extracting only the part that causes the exception and
then file a bug with it (attach it to the bug) -
http://mono-project.com/Bugs. Then post the bug number.
--
Kind Regards,
Ivan N. Zlatev
> Maybe this is because I store Font object in user settings:
>
> [global::System.Configuration.UserScopedSettingAttribute()]
> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
> [global::System.Configuration.DefaultSettingValueAttribute("Arial,
> 15pt")]
> public global::System.Drawing.Font TextBoxFont {
> get {
> return ((global::System.Drawing.Font)(this["TextBoxFont"]));
> }
> set {
> this["TextBoxFont"] = value;
> }
> }
>
>
> How to fix ?
>
> Andrus.
>
> Unhandled Exception: System.TypeInitializationException: An exception was
> thrown by the type initializer for
> MyApplication.Windows.Forms.Properties.Settings --->
> System.NotSupportedException: TypeConverter cannot convert from
> System.String.
>
> at System.ComponentModel.TypeConverter.GetConvertFromException
> (System.Object value) [0x00000]
> at System.ComponentModel.TypeConverter.ConvertFrom (ITypeDescriptorContext
> context, System.Globalization.CultureInfo culture, System.Object value)
> [0x00000]
> at System.ComponentModel.TypeConverter.ConvertFrom (System.Object o)
> [0x00000]
> at System.ComponentModel.TypeConverter.ConvertFromString (System.String
> text) [0x00000]
> at System.Configuration.ApplicationSettingsBase.CreateSettingsProperty
> (System.Reflection.PropertyInfo prop,
> System.Configuration.SettingsPropertyCollection properties,
> System.Configuration.LocalFileSettingsProvider& local_provider) [0x00000]
> at System.Configuration.ApplicationSettingsBase.get_Properties ()
> [0x00000]
> at System.Configuration.ApplicationSettingsBase..ctor () [0x00000]
> at MyApplication.Windows.Forms.Properties.Settings..ctor () [0x00000]
> at MyApplication.Windows.Forms.Properties.Settings..cctor () [0x00000]
>
> --- End of inner exception stack trace ---
>
> at MyApplication.Windows.Forms.UserLoginForm.InitializeComponent ()
> [0x00000]
> at MyApplication.Windows.Forms.UserLoginForm..ctor () [0x00000]
> at (wrapper remoting-invoke-with-check)
> MyApplication.Windows.Forms.UserLoginForm:.ctor ()
> at MyApplication.Windows.Forms.AppMainEntry.Main () [0x00000]
>
> _______________________________________________
> Mono-list maillist - Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
More information about the Mono-list
mailing list