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:
Passing in the framework version to psake: Unknown .NET Framework version, 4.6
Call the vsvars32.bat of VS2015 prior to invoking psake. PSake still uses the old MSBuild version.
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