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.