Original: About Exception Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
Exceptions to Microsoft.CSharp.RuntimeBinder.RuntimeBinderException generally come in two ways,
The first type:
Predefined type ' Microsoft.CSharp.RuntimeBinder.Binder ' is not defined or imported
The solution is to add micorsoft.csharp directly to the project reference.
The second type:
An exception of type ' Microsoft.CSharp.RuntimeBinder.RuntimeBinderException '
The error that caused this exception is because the anonymous type is not cross-assembly (assembly), the first solution is to use Expando, and the second is to include in the AssemblyInfo.cs of the source assembly:
[assembly: InternalsVisibleTo("NameSpace1.SubNameSpace1")]
After using the second method, the anonymous type can be passed to the target assembly.
----------------------Question 2-----------------------------------------------
Missing compiler required member ' Microsoft.CSharp.RuntimeBinder.Binder.Convert '
Workaround: Add a referenceMicrosoft.CSharp.dll
. This provides the required types for using dynamic
In C #.
About exception Microsoft.CSharp.RuntimeBinder.RuntimeBinderException