About Exception Microsoft.CSharp.RuntimeBinder.RuntimeBinderException

Source: Internet
Author: User

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 dynamicIn C #.

About exception Microsoft.CSharp.RuntimeBinder.RuntimeBinderException

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.