I am new to C# 4, especially the dynamic
keyword. I have seen quite a number of tutorials and wish to try it out myself using VS 2012 Ultimate (MSDN).
Unfortunately I cannot seem to find System.Dynamic
and cannot add a reference to it either. May I know where I can find the DLL for System.Dynamic
and what I might have done wrong?
By default, VS 2012 already targets Fx 4.5, and System.Core
is added as a reference.
The dynamic
keyword is so common that when searching in Google yield a lot of un-related results.
Best Answer
Make sure you are targeting the .NET Framework version 4 or later.
Ensure your project references the
System.Core
assembly.You will find the types and functionality of
System.Dynamic
in that assembly. Add the following line to your code files:P.S.: In C#, in order for the
dynamic
keyword to work properly, you also need to reference theMicrosoft.CSharp
assembly. This assembly contains the late-binding functionality necessary fordynamic
.