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.
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.
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