我在我的C#项目中使用了dynamic关键字.我得到以下错误
无法找到编译动态表达式所需的一种或多种类型.
下面是我的代码,我们正在使用VS 2013和.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);
Run Code Online (Sandbox Code Playgroud)
我已经按照其他链接中的建议引用了Microsoft.Chasharp DLL和System.Core DLL.
在引用Microsoft.Csharp DLL后,我收到了另一个错误
未定义或导入预定义类型microsoft.csharp.runtimebinder.
c# ×1