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 7524535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:06:25+00:00 2026-05-30T03:06:25+00:00

Error: Could not load System.Data.SqlServerCe.Entity.dll. Reinstall SQL Server Compact. Inner Exception: {Could not load

  • 0

Error:

Could not load System.Data.SqlServerCe.Entity.dll. Reinstall SQL Server Compact.

Inner Exception:

{"Could not load file or assembly 'System.Data.SqlServerCe.Entity, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"System.Data.SqlServerCe.Entity, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91"}

Steps to Reproduce:

  1. Create new MVC3 Application

  2. Add Nuget Package EntityFramework.SqlServerCompact

    <package id="EntityFramework.SqlServerCompact" version="4.1.8482.2" />

  3. Create Model

    public class TaskItem
    {
        [Key]
        public int Id { get; set; }
        public string Description { get; set; }
    }
    
  4. Create DbContext

    public class TestContext : DbContext
    {
        public DbSet<TaskItem> TaskItems { get; set; }
    }
    
  5. Home Controller

    public ActionResult Index()
    {
        var db = new TestContext();
        // breakpoint on Add() below
        db.TaskItems.Add(new TaskItem { Description = "Get shit done."});
        return View();
    }
    
  6. Web.config Connection String and Runtime and System.Data

    <add name="ApplicationServices" connectionString="Data Source=|DataDirectory|Test.sdf" providerName="System.Data.SqlServerCe.4.0" />

    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845dcd8080cc91" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.1" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
      <system.data>
        <DbProviderFactories>
          <remove invariant="System.Data.SqlServerCe.4.0" />
          <add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
        </DbProviderFactories>
      </system.data>
    

Question:

Web.config is all default… nothing funky here… all the DLLs are copy local and in bin… what am I missing? It’s got to be something very simple.


Update:

Removing the Dependent Assembly section from web.config solved the problem, but I still need an explanation why in order to close the answer.

  • 1 1 Answer
  • 0 Views
  • 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-30T03:06:26+00:00Added an answer on May 30, 2026 at 3:06 am

    Remove the dependent assembly binding from your web.config

      <dependentAssembly>
        <assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845dcd8080cc91" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.1" />
      </dependentAssembly>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could not load file or assembly 'System.Data' or one of its dependencies. An attempt
The exact error is as follows Could not load file or assembly 'Microsoft.SqlServer.Replication, Version=9.0.242.0,
I'm currently getting a Could not load type UI.Administration.Site.master error message and I'm not
Why does eclipse break with the error Could not write file: M:\workspaces\eclipse\project.project. M:\workspaces\eclipse\project.project (Access
I'm getting the build error 'error VCBLD0007: Could not find project configuration RELEASE|X64 to
I'm getting an error: GenerationException: url_for could not generate URL. Called with args: ()
I am receiving a CoreData could not fulfill a fault for ... error message
I'm getting this Hibernate error: org.hibernate.MappingException: Could not determine type for: a.b.c.Results$BusinessDate, for columns:
i am getting this error failed to execute request because the app-domain could not
We get the following error; The request was aborted: Could not create SSL/TLS secure

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.