Stefan Kueng - 2018-01-31

When replacing, the$ char is special in regex lingo.
You have to escape it:
<TargetFrameworkVersion>\$(MyTargetFramework)</TargetFrameworkVersion>