Invalid value for 'OSVersion'
Thanks to Mike Wade @ Microsoft
I would recommend clearing the environment variable, or better yet, adding the following to the project file:
<PropertyGroup>
<OSVersion></OSVersion>
</PropertyGroup>
This will fully override the environment variable and blank it out. The task should then set this to a better default value.