Search code examples
c#serializationpropertiesfieldautomatic-properties

Will use 'k_BackingField' cause version compatibility problem?


Recently, I'm working on serialization with C#.

I found that the automatic-properties' fields are named "<...>k_BackingField".

So my problem is dose this naming rule same in all .Net versions, and it won't change in any situations?


Solution

  • It's an internal implementation that may change between the different versions of the C# compiler.

    The different serialization mechanisms provided by the libraries have different compatibility rules. For instance, I do not believe that binary serialization is guaranteed to work between different versions of the framework.