Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Predefined type microsoft.csharp.runtimebinder is not defined or imported

Tags:

c#

I'm using the dynamic keyword in my C# project. I get the below error

One or more types required to compile a dynamic expression cannot be found.

Below is my code and we are using VS 2013 with .NET Framework 4.5.1.

dynamic cstmDocProp = (Microsoft.Office.Core.DocumentProperties)mScribeShell.ScribeShell.ActiveWordDoc.CustomDocumentProperties;   string s = String.Empty; s = Convert.ToString(cstmDocProp[mConstants.g_sPROPERTY_DOCUMENT_INDEX].Value); 

I have already referred Microsoft.Chasharp DLL and System.Core DLL as suggested in other links.

After referring Microsoft.Csharp DLL I'm getting another error as

predefined type microsoft.csharp.runtimebinder is not defined or imported.

like image 678
Guruprasad Avatar asked Mar 19 '14 08:03

Guruprasad


Video Answer


1 Answers

  • Right Click on your project and select 'Add reference'

  • Select 'Assemblies->Framework' in 'Reference Manager' window.

  • Add select Microsoft.CSharp.dll and click on add.

Hope this will solve your problem.

like image 119
Tom Avatar answered Sep 20 '22 12:09

Tom