Maybe @curtisw can confirm but I think the official advice is to multi-target - and the samples are set up that way - that means to write code compatible with both frameworks - but if you do that you cannot reference .net7 only projects as you have found.
What i think you are asking for is to target .net 7 only - to do that run the upgrade tool on the project.