In Roslyn we still build some packages against net45. The .NET Framework 4.5 targeting pack is not longer installed by default (or even available) in the VS2022 installer.
We would expect if all of the following occur, then include the package:
- AutomaticallyUseReferenceAssemblyPackages is true
- The targeting pack is not known to be available at time of restore
- NuGet static restore graph is used (currently this implies the previous item)