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.
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
.
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With