我在我的C#项目中使用了动态关键字,但我收到以下错误:
编译动态表达式所需的一个或多个类型未找到。
下面是我的代码,我们正在使用VS2013和.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);
我已经按照其他链接中建议的引用了Microsoft.Chasharp DLL和System.Core DLL。
在引用Microsoft.Csharp DLL之后,我遇到了另一个错误,即
预定义类型microsoft.csharp.runtimebinder未定义或未导入。