You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a problem with TypeExtensions.GetPublicInstanceProperties(). it get's also all static and nonpublic properties.
A short blink into ILSpy I saw that GetRuntimeProperties() will call GetProperties(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic). So GetPublicInstanceProperties() will also get static and nonpublic properties.
I changed the code to solve this problem:
extended AdvancedSharpSerializerBinarySettings with two new properties public bool IncludeStaticProperties { get; set; } public bool IncludeNonPublicProperties { get; set; }
extended the PropertyProvider with two new properties public bool IncludeStatic { get; set; } public bool IncludeNonPublic { get; set; }
assigning the props in SharpSerializer.initialize() PropertyProvider.IncludeNonPublic = settings.AdvancedSettings.IncludeNonPublicProperties; PropertyProvider.IncludeStatic = settings.AdvancedSettings.IncludeStaticProperties;
Hi
There is a problem with TypeExtensions.GetPublicInstanceProperties(). it get's also all static and nonpublic properties.
A short blink into ILSpy I saw that GetRuntimeProperties() will call GetProperties(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic). So GetPublicInstanceProperties() will also get static and nonpublic properties.
I changed the code to solve this problem:
extended AdvancedSharpSerializerBinarySettings with two new properties
public bool IncludeStaticProperties { get; set; }
public bool IncludeNonPublicProperties { get; set; }
extended the PropertyProvider with two new properties
public bool IncludeStatic { get; set; }
public bool IncludeNonPublic { get; set; }
assigning the props in SharpSerializer.initialize()
PropertyProvider.IncludeNonPublic = settings.AdvancedSettings.IncludeNonPublicProperties;
PropertyProvider.IncludeStatic = settings.AdvancedSettings.IncludeStaticProperties;
finally changed PropertyProvider.GetAllProperties()
Hope, this helps someone with the same problem.
Cheers, jaz (bluebat)
The text was updated successfully, but these errors were encountered: