Because the <TargetFramework> node precedes the <TargetFramework> node, it is not possible to change the target framework for a project once it has been set using <TargetFramework>. In those cases <TargetFrameworks> must be used instead.
<Project>
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
</PropertyGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="common.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</Project>
<Project>
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
</PropertyGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="common.props" />
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>
</Project>