Make the template aware of the current MSBuild version so that tasks are from the proper version.

Fixes an issue that caused an invalid cast if building using MSBuild 12.0.