Fix for target framework issue

(cherry picked from commit 47730f8705c067ef48cfed2a84a3613f4b8a8d0b)
Fix the check for version spec

(cherry picked from commit 9c2288bb19b9b301177396ddf7c991d3f4b6d73d)