[Mono-bugs] [Bug 414445] Font cannot deserialized from string

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Aug 5 05:22:32 EDT 2008


User kobruleht2 at hot.ee added comment

andrus moor <kobruleht2 at hot.ee> changed:

           What    |Removed                                         |Added
             Status|RESOLVED                                        |REOPENED
         Resolution|WORKSFORME                                      |

--- Comment #4 from andrus moor <kobruleht2 at hot.ee>  2008-08-05 03:22:31 MDT ---
I created new code to reproduce exception below.

Steps to reproduce exception using code below

1. Compile with Visual Studio or with mono 2.0 preview 1:

gmcs -pkg:dotnet -target:winexe test.cs

2. run using 

mono test.exe 2>t


Unhandled Exception: System.TypeInitializationException: An exception was
thrown by the type initializer for 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)
  at System.ComponentModel.TypeConverter.ConvertFrom (System.Object o)
  at System.ComponentModel.TypeConverter.ConvertFromString (System.String text)
  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 Settings..ctor () [0x00000] 

  at Settings..cctor () [0x00000] 

  --- End of inner exception stack trace ---

  at Program.Main () [0x00000] 

About previous code: I installed 2.0 preview 1 from binary distribution
package. Running code compiled with Visual Studio shows Arial font. I have
arial font installed.
So I expect running code from mono must show Arial font also.

New code to reproduce exception:

using System.Windows.Forms;
using System.Configuration;
using System.Drawing;

public sealed class FormData  
    public Point Location;
    public Size ClientSize;
    public FormWindowState WindowState;
    public int SplitterDistancePercent;
    string FormName;
    FormData() { }

class Settings : ApplicationSettingsBase
    private static Settings defaultInstance =
((Settings)(ApplicationSettingsBase.Synchronized(new Settings())));

    public static Settings Default
            return defaultInstance;

          <FormData xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""
        Arial, 12pt

    public FormData Mainform
            return ((FormData)(this["Mainform"]));
            this["Mainform"] = value;

    [DefaultSettingValueAttribute("Arial, 10pt")]
    public Font font
            return ((Font)(this["font"]));

class Program
    static void Main()
        var res = Settings.Default.Mainform; //.font;
        MessageBox.Show(res.Location.ToString()); //.ToString());

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list