[VS2015]. Using the. NET2.0 assembly in a NET4.0 environment, the "mixed-mode assembly exception" occurs with the SQLite times exception

Source: Internet
Author: User
Tags mixed sqlite sqlite database

Using the SQLite times exception in the. NET 4.0 environment

Mixed-mode assemblies are generated for the "v2.0.50727" version of the runtime, and cannot be loaded in the 4.0 runtime without additional information being configured the method that it calls is to get the database connection that was already used from the SQLite database, not at the time. is ready to set breakpoints and then single-step debugging, the result is a breakpoint can not enter the method body, and then carefully looked at the method body when found a problem, Is the existing System.Data.Sqlite this data access provider is for. NET2.0 Environment Development (the latest version is 1.0.66.0, released on April 18, 2010), and the current official has not given the latest. NET4 data access support.

Workaround:

Add a configuration item to the configuration file <supportedruntime version= "v2.0.50727"/>

As shown below:

<?xml version= "1.0" encoding= "Utf-8"?>
<configuration>

<startup uselegacyv2runtimeactivationpolicy= "true" >

<supportedruntime version= "v4.0" sku= ". netframework,version=v4.0 "/>

<supportedruntime version= "v2.0.50727"/>


</startup>

</configuration>

[VS2015]. Using the. NET2.0 assembly in a NET4.0 environment, the "mixed-mode assembly exception" occurs with the SQLite times exception

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.