[英]Predefined type microsoft.csharp.runtimebinder is not defined or imported
I'm using the dynamic keyword in my C# project. 我在我的C#项目中使用了dynamic关键字。 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. 下面是我的代码,我们正在使用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);
I have already referred Microsoft.Chasharp DLL and System.Core DLL as suggested in other links. 我已经按照其他链接中的建议引用了Microsoft.Chasharp DLL和System.Core DLL。
After referring Microsoft.Csharp DLL I'm getting another error as 在引用Microsoft.Csharp DLL后,我收到了另一个错误
predefined type microsoft.csharp.runtimebinder is not defined or imported.
未定义或导入预定义类型microsoft.csharp.runtimebinder。
Right Click on your project and select 'Add reference' 右键单击您的项目并选择“添加引用”
Select 'Assemblies->Framework' in 'Reference Manager' window. 在“Reference Manager”窗口中选择“Assemblies-> Framework”。
Add select Microsoft.CSharp.dll
and click on add. 添加选择
Microsoft.CSharp.dll
并单击添加。
Hope this will solve your problem. 希望这能解决你的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.