Skip to content

Releases: cdervis/SharpConfig

v4.1

08 Apr 21:35

Choose a tag to compare

SharpConfig 4.1

  • Added StringComparison overload support to GetSectionsNamed() and GetSettingsNamed(), while keeping the default behavior as StringComparison.OrdinalIgnoreCase.
  • Clarified the public documentation around create-or-get indexers and name matching behavior (see README).
  • Fixed stream ownership inconsistencies:
    • LoadFromStream() now leaves caller-provided streams open.
    • LoadFromBinaryStream() now leaves caller-provided BinaryReader instances and streams open.
    • SaveToBinaryStream() now leaves caller-provided BinaryWriter instances open.
    • Stream-based load/save APIs now consistently leave caller-owned streams usable after the operation.
    • Binary/text stream internals now use explicit leaveOpen handling instead of relying on disposal side effects.
  • Reduced allocations in textual stream save by writing through StreamWriter instead of building and encoding an intermediate byte buffer.
  • Cached reflection metadata used for object mapping to avoid repeated member scans without changing observable behavior.
  • Removed the deprecated Configuration.StringRepresentation property.

v4.0

23 Jan 21:21

Choose a tag to compare

SharpConfig 4.0

This major update modernizes the library for the latest .NET ecosystem, improves performance, and introduces native support for multiline values.

Please note that this is a major release with breaking changes!

New Features & Enhancements

  • .NET 10 Support: Full support for .NET 10 while maintaining .NET Standard 2.0 compatibility.
  • Multiline Values: Native support for parsing and saving multiline strings using the [[ ... ]] syntax.
  • MultilineAttribute: New attribute to automatically handle multiline strings during object mapping (ToObject and FromObject).
  • Nullable Reference Types: The entire library now uses nullable reference types for improved type safety and fewer null-reference exceptions.
  • Performance Optimizations: Significant performance improvements in parsing, string handling, and setting lookups.
  • New API Methods:
    • Configuration.SaveToString(): A modern replacement for the StringRepresentation property.
    • Configuration.ResetOptions(): Resets all global configuration options to their default states.
    • Configuration.FindTypeStringConverter(): Publicly accessible converter lookups.

Breaking Changes & Deprecations

  • Nullable API: Method signatures have been updated to reflect nullability.
  • Obsolete: Configuration.StringRepresentation is now obsolete; use SaveToString() instead.
  • Removed: Setting.StringValueTrimmed has been removed (use StringValue).
  • Modernized: Legacy target frameworks (older than .NET Standard 2.0) are no longer officially supported.

Fixes

  • Optimized comment character lookups using HashSet.
  • Improved null safety in Section.Remove() and Section.ToObject().
  • Fixed edge cases when handling inline comments within section headers.
  • Refined array element separator handling across different culture settings.

v3.2.9.1

18 Aug 17:21

Choose a tag to compare

Migrate