andywilsonuk / StringTokenFormatter

Provides string extension methods for replacing tokens within strings (using the format '{name}') with their specified lookup value.
Apache License 2.0
37 stars 1 forks source link

V7.1 settings issue #30

Closed DanAvni closed 12 months ago

DanAvni commented 12 months ago

Trying to use V7.1 I came across this issue My function below is not compiling with error CS8370 Feature 'init-only setters' is not available in C# 7.3. Please use language version 9.0 or greater. My project is a netstandards 2 project.

`

    private static StringTokenFormatterSettings GetSettings()
    {
        return new StringTokenFormatterSettings()
        {
            InvalidFormatBehavior = InvalidFormatBehavior.LeaveUnformatted,
            UnresolvedTokenBehavior = UnresolvedTokenBehavior.LeaveUnresolved,
            TokenResolutionPolicy = TokenResolutionPolicy.ResolveAll
        };
    }

`

Any ideas?

DanAvni commented 12 months ago

Sorry I didn't see that V7.1 is only .NET Framework 4.8 and .NET 6 compatible.