question

Atmapuri-5752 avatar image
0 Votes"
Atmapuri-5752 asked TimonYang-MSFT commented

How to debug custom CodeDomSerializer

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

dotnet-csharp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

TimonYang-MSFT avatar image
0 Votes"
TimonYang-MSFT answered TimonYang-MSFT commented

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.


1.png (38.7 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Dear Timon,

There is no error message and no stack trace. Our custom CodeDomSerializer works for .NET before v5.0. Other that the components get to be deleted, there is no error message. Of course, if we remove the attribute that causes the custom serializer to trigger, then the components load, but are not correctly serialized.

Kind Regards!
Atmapuri

0 Votes 0 ·

@Atmapuri-5752
Does this issue only occur in .Net 5?
Then I think you'd better go to the GitHub repository below to ask an issue, which may not be solved by programming.
.NET 5 Preview 5

0 Votes 0 ·