msbuildvisual-studio-2015c#-6.0psake

Force MSBuild 14.0 in psake build for C# 6.0 code base


I recently updated to Visual Studio 2015 and am using the new C# 6.0 features. In VS, everything builds correctly.

However, I use PSake as build script language, and the build always fails at places where I use c# 6.0 features. How can I tell psake to use MSBuild 14.0, so that the new c# 6.0 features build correctly?

Tried & failed:


Solution

  • I had the same issue & fixed it by configuring PSake build script to use .Net Framework 4.6, simply by adding Framework "4.6" in the beginning of the file. You may check this unit test from PSake code base dotNet4.6_should_pass.ps1