-
Notifications
You must be signed in to change notification settings - Fork 480
Description
I have a small net5 project where I use the FCTB.
And when I start the programm localy in Visual Studio or over they exe there are not problems.
But if I use the publish feature from net5 und try to start the exe I get the following Error:
Exception Info: System.Runtime.Serialization.SerializationException: Invalid BinaryFormatter stream.
---> System.TypeInitializationException: The type initializer for 'System.Runtime.Serialization.Formatters.Binary.Converter' threw an exception.
---> System.IO.FileNotFoundException:
....
After some searching I did found that the problem is the ServiceColor serialization, in the desinger generated code.
But if I remove the following line, in the desinger generated code:
this.InputFCTextBox.ServiceColors = ((FastColoredTextBoxNS.ServiceColors)(resources.GetObject("InputFCTextBox.ServiceColors")));
It does work again.
But I can't save the ServiceColors.
My solution was to remove the [Serializable] attribute from the ServiceColors class.
Than the ServiceColor does not get serializated and stored in the resx file.
Instead the ServiceColors will be stored in the desinger generated code.
I do not unterstand why the ServiceColors must be serializated.
It does take up more space then the generated code.