SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

CodeDomSerializerBase.DeserializeExpression Error

Last post 04-05-2007 6:38 AM by lzars. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-03-2007 4:47 AM

    • lzars
    • Top 200 Contributor
    • Joined on 08-31-2006
    • Posts 13

    CodeDomSerializerBase.DeserializeExpression Error

    I have a  implemented a form designer(DesignSurface). i use Nrefactory to parse the code into a codeCompileUnit. but if the code has the following line

    Me.button1.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Bold)

    the form designer errors when it is trying to load.

    The type 'System.Drawing.FontStyle' has no property named 'Bold'.

       at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager manager, String exceptionText, String helpLink)
       at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
       at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
       at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
       at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)

     

    My TypeResolutionService returns the type "System.Drawing.FontStyle".
    i don't know what i could be doing wrong .... this same thing happens with other enums. any ideals

    Much Thanks

    Leif

    Filed under: ,
  • 04-03-2007 1:07 PM In reply to

    Re: CodeDomSerializerBase.DeserializeExpression Error

    The basic problem is that just by seeing the syntax, there's no way for NRefactory to know if B in "A.B" is a property or field. However, it has to return a CodeFieldReference or CodePropertyReference - if the CodeDomVisitor returns the wrong one, you'll get the error you are seeing.

    NRefactory cannot solve this problem because it doesn't have information about what "A" is. You will have to implement the interface IEnvironmentInformationProvider and assign an instance of your implementation to CodeDomVisitor.EnvironmentInformationProvider.

    Daniel Grunwald
  • 04-05-2007 6:38 AM In reply to

    • lzars
    • Top 200 Contributor
    • Joined on 08-31-2006
    • Posts 13

    Re: CodeDomSerializerBase.DeserializeExpression Error

    thanks i will give that a try
Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.