Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1095679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:09:48+00:00 2026-05-17T00:09:48+00:00

I have a UI & Library project for the solution where I’m having the

  • 0

I have a UI & Library project for the solution where I’m having the problem. The library project uses Entity Framework & the unit tests work OK with it. The project is a C# 4.0 WPF application.

To try to get a basic EF line of code working I copied the connection string from the Library project app.config to the UI project app.config.

When I run the project with a simple EF test couple of lines (see below) I get the error below. Note that both projects are set to use the .NET Framework 4 already. I do use other libraries such as Quartz.Net, however everything works fine until I include the below line.

Any suggestions re how to correct this issue?

    // Test ONly
    using (var dbContext = new Model1Container())
    {
        Debug.WriteLine("Total Usages = " + dbContext.Usages.Count());
    }

Error:

“Mixed mode assembly is built against version ‘v2.0.50727’ of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.”

Connection String I copied into the UI project app.config

  <connectionStrings>
    <add name="Model1Container" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SQLite;provider connection string='data source=&quot;C:\Documents and Settings\Owner\My Documents\My Dropbox\source\MyInternetUsage\MyInternetUsageLibrary\MyInternetUsage.sqlite&quot;'" providerName="System.Data.EntityClient" />
  </connectionStrings>
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T00:09:48+00:00Added an answer on May 17, 2026 at 12:09 am

    Add the following directive to your app.config

    <startup useLegacyV2RuntimeActivationPolicy="true">
      <supportedRuntime version="v4.0"/>
    </startup>
    

    This should fix your mixed mode problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a wcf service library project that includes my service contract &
I have a rather loaded question regarding a library/framework my company uses to build
I have implemented the Tessnet2 library to work in my Web Project. While debugging
I have MVC3 project & Valums file uploader . The code is following <script
I have a Visual C++ solution with 2 projects AlgorithmA & AlgorithmB and both
I have a class library which is being used by another project, it is
I have 3 class library projects. Lets call them A, B & C. I
I have included three20 library in my project. I am making use of the
In the project I am currently working on http://sourcecodecloud.codeplex.com/ I have a library containing
I have a VS solution that contains 6 library projects and 1 web folder

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.