Context
TVO generates dead code that is unfriendly towards runtimes that are older than .NET 7.
Explanation
TVO, by default generates types for the following augments, regardless of whether the features are used or not:
DefaultEqualityComparerAugment.g.cs
DefaultValueAugment.g.cs
EfCoreAugment.g.cs
JsonAugment.g.cs
IDefaultEqualityComparer.g.cs
IDefaultValue.g.cs
IValueObject.g.cs
The first 4 can only be used on .NET 5 and above due to ExcludeFromCodeCoverage with Justification.
/// <summary>
/// Augment to enable JSON support by generting a JSON converter for the value object.
/// </summary>
/// <remarks>
/// This only supports <c>System.Text.Json</c> at the moment.
/// </remarks>
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage(Justification = "Auto-generated")]
internal sealed class JsonAugment : global::TransparentValueObjects.IAugment { }
The last 3 can only be used on (.NET 6 with LangVersion==preview) or .NET 7+, due to use of static abstract.
/// <summary>
/// Represents the interface for <see cref="global::TransparentValueObjects.DefaultEqualityComparerAugment"/>
/// with members that the consumer has to implement to support the augment.
/// </summary>
internal interface IDefaultEqualityComparer<out TValueObject, TInnerValue>
where TValueObject : global::TransparentValueObjects.IValueObject<TInnerValue>
where TInnerValue : notnull
{
/// <summary>
/// Gets a equality comparer for the inner value type to be used by default.
/// </summary>
public static abstract global::System.Collections.Generic.IEqualityComparer<TInnerValue> InnerValueDefaultEqualityComparer { get; }
}
Expected Outcome
Alternatively source generator warns if TargetFramework is set too low.
Supporting Evidence
When no augments used.

Context
TVO generates dead code that is unfriendly towards runtimes that are older than .NET 7.
Explanation
TVO, by default generates types for the following augments, regardless of whether the features are used or not:
DefaultEqualityComparerAugment.g.csDefaultValueAugment.g.csEfCoreAugment.g.csJsonAugment.g.csIDefaultEqualityComparer.g.csIDefaultValue.g.csIValueObject.g.csThe first 4 can only be used on
.NET 5and above due toExcludeFromCodeCoveragewithJustification.The last 3 can only be used on (.NET 6 with
LangVersion==preview) or .NET 7+, due to use of static abstract.Expected Outcome
Unused code is not generated.
ExcludeFromCodeCoveragew/ Justification is used on.NET 5+only. Older runtimes use no justification.Alternatively source generator warns if
TargetFrameworkis set too low.Supporting Evidence
When no augments used.