VS2015 build fails with no error message with Dynamic

There is a compiler error, Visual Studio 2015 just does not report the error properly. However, Visual Studio 2013 does:

This is answered here: https://stackoverflow.com/a/13568247:

In short:

Add a reference to Microsoft.CSharp in order to use dynamic like this.


Had this issue using dynamic keyword in combination with Newtonsoft.json in a .net 3.0 project.

The fix was to drop dynamic altogether and use JObject instead:

from

dynamic locales = JObject.Parse(this.Locales);

to

JObject locales = JObject.Parse(this.Locales);

As two people have noted in comments, for Net Core and NetStandard, this problem is sometimes fixed by adding a NuGet reference to Microsoft.CSharp.