Update projects to net7.0 TargetFramework with shared property
Fixes https://github.com/dotnet/command-line-api/issues/1792
From that issue:
Source build requires projects to build with the current TFM or a supported netstandard TFM. command-line-api currently targets net6.0. Ideally this would be updated to net7.0. If that is not possible, the TFM could be conditioned for source-build but ideally the regular and source build would be identical.
I'm seeing this error when testing locally:
/home/logan/vcs/command-line-api/src/System.CommandLine/Binding/ArgumentConverter.DefaultValues.cs(34,20): error IL2070: 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Type.GetConstructor(Type[])'. The parameter 'listType' of method 'System.CommandLine.Binding.ArgumentConverter.CreateEmptyList(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. [/home/logan/vcs/command-line-api/src/System.CommandLine/System.CommandLine.csproj]
Not sure what to change to fix this.
cc @jonsequitur
@jonsequitur - this is ready for a final review.
@jonsequitur, @brettfo, will these changes flow into SDK and eventually installer/release/7.0.1xx? It's been a while since this was merged and usually changes flow by then. If not, then where do I need to backport this change to?
Ping @jonsequitur, @brettfo.
Hi, we set up a darc feed for you https://github.com/dotnet/sdk/pull/28410