A mixed-mode assembly is generated for the runtime of "v2.0.50727". It cannot be loaded at the 4.0 runtime without other information ., The hybrid mode assembly is

Source: Internet
Author: User

A mixed-mode assembly is generated for the runtime of "v2.0.50727". It cannot be loaded at the 4.0 runtime without other information ., The hybrid mode assembly is

When calling some third-party libraries, the third-party libraries are based on. NET2.0. Therefore, it cannot be loaded in the 4.0 program. The solution is as follows:

Add the following configuration in the configuration file:

<? Xml version = "1.0"?> <Configuration> <startup useLegacyV2RuntimeActivationPolicy = "true"> <supportedRuntime version = "v4.0" sku = ". NETFramework, Version = v4.0 "/> <supportedRuntime version =" v2.0.50727 "/> </startup> </configuration> View Code

Enable the. NET Framework 2.0 runtime activation policy, which is to load all the Assembly by using the latest supported runtime.

If the program uses the. NET2.0 and. NET3.5 programs in the. NET4.0 environment, you must set useLegacyV2RuntimeActivationPolicy to true,

At the same time, you must add the supportedRuntime configuration section in the bytes in the startup configuration section and specify it as "v4.0" to run the program using the. NET4.0 runtime.

Related Article

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.