2

I have implemented a custom BuildTask and set the build engine in it. But while executing the code, I am getting this exception

Method not found: 'Void Microsoft.Build.Utilities.Task.set_BuildEngine(Microsoft
.Build.Framework.IBuildEngine)'.

What can be possible cause of this?

Varun Mahajan
  • 7,037
  • 15
  • 43
  • 65

2 Answers2

2

You may be using two different versions of the Microsoft Build Framework (Microsoft.Build.Framework). Check the version numbers in the item properties to make sure they're not different (e.g. my issue - Version 4.0.0.0 and Version 14.0.0.0)

Ryan
  • 970
  • 15
  • 36
0

For me, the problem started when I upgraded the build project to use Visual Studio 2015. The build task that was being tested was referencing the Microsoft.Build.Framework that was installed into the GAC (4.0.0.0.). I had to set the HintPath to use the MSBuild 14 version of the Microsoft.Build.Framework on the assembly that was being tested as well as the test assembly and that fixed the problem.

thor
  • 21,418
  • 31
  • 87
  • 173