Click here to Skip to main content
15,888,254 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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".

Kindly suggest.

Thanks
Posted
Updated 25-Apr-16 1:09am

1 solution

Just remove the reference to Microsoft.CSharp.dll, add it and rebuild your application.

If that doesn't work you can also add a reference to System.Core.dll and try again.

Under normal circumstances, references are added to the
C#
Microsoft.CSharp.dll
and
C#
System.Core.dll

dlls when a new project is created.
 
Share this answer
 
v2
Comments
Richard MacCutchan 25-Apr-16 7:11am    
This question is more than 2 years old!
idzodzo 25-Apr-16 7:13am    
I just added a response so that it can be helpful to someone else...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900