How to debug custom CodeDomSerializer

Atmapuri 1 Reputation point
2021-04-12T13:26:18.307+00:00

Dear All,

When building our software with Winforms.NET Core 5.0, one of the custom CodeDomSerializers is not working (the component gets to be deleted). How can we debug in to the Serializer?

The best what I could find is this:
https://stackoverflow.com/questions/47290751/serialization-with-codedomserializer-how-to-initialize-manager-object

But this wont work with VS2019, because the type needs the object used by the VS2019.

Thanks!
Atmapuri

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
7,020 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Timon Yang-MSFT 9,501 Reputation points
    2021-04-13T03:25:22.08+00:00

    Is the error message you encountered like this:

    87137-1.png

    According to this information, it seems that the designer mistakenly confused two classes with the same name.

    Please try adding it manually to see if it works:

            private void Form1_Load(object sender, EventArgs e)  
            {  
                myComponent1 = new MyComponent();  
                this.myComponent1.LocalProperty = "Component Property Value";  
            }  
    

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.