Go to C #. NET4.0 mixed-mode assembly exception

Source: Internet
Author: User

1. Refer to the 2 files of Microsoft.DirectX.dll and Microsoft.DirectX.Directsound.dll.
2. Project attribute inside, change target platform to X86.
3.app.config modified under:

1 <?XML version= "1.0"?>2 <Configuration>3     <StartupuseLegacyV2RuntimeActivationPolicy= "true"> 4       <supportedruntimeversion= "v4.0"SKU=". netframework,version=v4.0 "/>5     </Startup>6 </Configuration>

Using the Dirext3d managed library under. NET 4.0, the "mixed-mode assembly was generated for the v1.1.4322" version of the runtime and cannot be loaded in the 4.0 runtime without additional information being configured. "Exception information, view the assembly Microsoft.DirectX.dll, Microsoft.DirectX.Direct3D.dll, Microsoft.DirectX.Direct3DX, and discover its. NET The runtime version is v1.1.4322, which means that the D3D managed library was built under the. NET v1.1 version.

In. NET4.0 before, due to the nature of the program operating environment or. NET2.0, and. NET2.0 compatible. NET1.0 and 1.1, but when you upgrade to. NET4.0, the. NET kernel makes significant adjustments to assemblies that were previously generated in. Net2.0 or. net3.5, if you want to run under. net4.0, You need to specify the common language runtime version supported by this application in the configuration file and enable the. NET Framework 2.0 Runtime Activation policy, the appropriate app. config is as follows:

1 <?XML version= "1.0"?>2 <Configuration>3   <StartupuseLegacyV2RuntimeActivationPolicy= "true">4     <supportedruntimeversion= "v4.0"/>5   </Startup>6 </Configuration>

Reference from MSDN, specific address: http://msdn.microsoft.com/zh-cn/library/bbx34a2h.aspx

Turn from: http://blog.csdn.net/shenyc/article/details/7872300

Go to C #. NET4.0 mixed-mode assembly exception

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.