[Core] Fixed logic for determining if TargetFrameworks can ref .NETPortable frameworks

Fixes bug #9163