简体   繁体   中英

Need suggestions for work around for programming error “Cannot serialize non-public type MS.Internal.NamedObject”?

Error occurs saving wpf RichtextBox contents; and also on line to remove the InlineUIContainer containing the button before recreating with new content. The save action works fine so long as the content of a button has not been modified. The line that modifies the content is simply;

_btnBookmark.Content = cbm.BkmkContent;

The button _btnBookmark is capture when the inline gets focus and has been verified as valid with all properties are as expected. The update of content occurs with no error and the new content is as expected.

The line for removing the inline with the button is simply;

this.rtbDoc.CaretPosition.Paragraph.Inlines.Remove(iuic);

The inlineUIContainter variable iuic is valid and contains the child button as expected.

I cannot see any way to alter my code to prevent these errors. This application was started in VS2010 and I believe these lines of code were working then. I recently upgraded to VS2015 community version and these errors appeared.

for others who might run into this error; mine was due to a corrupted project. This might have been caused by recently adding a Windows Installer setup project to the solution or maybe not. Anyway, restoring a previous version of the project caused the errors to disappear.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM