简体   繁体   English

未定义或导入预定义类型microsoft.csharp.runtimebinder

[英]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.

相关问题 立即窗口中的动态导致'Microsoft.CSharp.RuntimeBinder.Binder'未定义或导入错误 - Dynamic in the immediate window causes 'Microsoft.CSharp.RuntimeBinder.Binder' is not defined or imported error 缺少类型Microsoft.CSharp.RuntimeBinder.Binder - Missing type Microsoft.CSharp.RuntimeBinder.Binder 发生了“Microsoft.CSharp.RuntimeBinder.RuntimeBinderException”类型的第一次机会异常 - A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred Microsoft.CSharp.RuntimeBinder.RuntimeBinderException错误 - Microsoft.CSharp.RuntimeBinder.RuntimeBinderException Error Mono 4(3.1.2工作正常),无法加载类型Microsoft.CSharp.RuntimeBinder.RuntimeBinderContext - Mono 4 (3.1.2 worked fine), Could not load type Microsoft.CSharp.RuntimeBinder.RuntimeBinderContext 发生``Microsoft.CSharp.RuntimeBinder.RuntimeBinderException'' - 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred 访问动态属性会引发“Microsoft.CSharp.RuntimeBinder.RuntimeBinderException”类型的异常 - Accessing a dynamic's property threw an exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' 未定义或导入预定义类型 System.Range - predefined type System.Range is not defined or imported 未定义或导入预定义类型System.Object - Predefined type System.Object is not defined or imported 未定义或导入预定义类型“System.ValueTuple`2” - Predefined type 'System.ValueTuple`2' is not defined or imported
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM