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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:12:47+00:00 2026-06-09T06:12:47+00:00

Using Entity Framework 5.0.0 RC/EF 5.x DbContext Generator for C#/Visual Studio 2012 RC/.NET 4.0,

  • 0

Using Entity Framework 5.0.0 RC/EF 5.x DbContext Generator for C#/Visual Studio 2012 RC/.NET 4.0, I’m trying to enable automatic migrations in my project. I’ve run enable-migrations in the Package Manager Console:

PM> enable-migrations
No classes deriving from DbContext found in the current project.
Edit the generated Configuration class to specify the context to enable migrations for.
Code First Migrations enabled for project Test.

As you can see, it didn’t automatically detect my DbContext derived type, but I solved this easily enough by entering the name of this type in the generated code file, Migrations/Configuration.cs.

However, the next step, the Package Manager Console command enable-migrations fails due to not finding the migrations configuration type added by the previous step.

PM> add-migration Initial
No migrations configuration type was found in the assembly 'Test'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration).

How can I solve this?

EDIT: I found that I could specify the name of the configuration type with the parameter -ConfigurationTypeName:

PM> add-migration -ConfigurationTypeName Test.Migrations.Configuration Initial
The type 'Configuration' is not a migrations configuration type.

This still doesn’t work, but at least it elucidates why add-migration bails, i.e. it thinks Test.Migrations.Configuration isn’t a migrations configuration type. Does anyone have a clue as to why it isn’t accepted, given that it was generated by enable-migrations? See the generated code below for reference (UserModelContainer derives from DbContext):

namespace Test.Migrations
{
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Migrations;
    using System.Linq;
    using Test.Models;

    internal sealed class Configuration : DbMigrationsConfiguration<UserModelContainer>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
        }

        protected override void Seed(UserModelContainer context)
        {
            //  This method will be called after migrating to the latest version.

            //  You can use the DbSet<T>.AddOrUpdate() helper extension method 
            //  to avoid creating duplicate seed data. E.g.
            //
            //    context.People.AddOrUpdate(
            //      p => p.FullName,
            //      new Person { FullName = "Andrew Peters" },
            //      new Person { FullName = "Brice Lambson" },
            //      new Person { FullName = "Rowan Miller" }
            //    );
            //
        }
    }
}
  • 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-06-09T06:12:49+00:00Added an answer on June 9, 2026 at 6:12 am

    The issue turned out to be that I had installed Entity Framework 5.0.0 RC while targeting .NET framework 4.5. Due to deploying to Windows Azure, I found I had to target .NET 4.0 instead. I don’t know the intricacies of NuGet, but it seems that the EF package installed for .NET 4.5 didn’t work properly with my 4.0 targeting project.

    After reinstalling the EF NuGet package, while targeting my project at .NET 4.0, everything works well.

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

Sidebar

Related Questions

I am building an ASP.NET MVC web application using entity framework DbContext using the
My scenario I'm using Visual Studio 2010 with Entity Framework 4.1 I have a
The goal: I'm trying to use the new Entity Framework 4.1 DbContext API (using
Using Entity Framework, I suddenly get this strange error after publishing my asp.net mvc
I am using Entity Framework. I am trying to get the results from linq
I'm trying out the new scaffolding features in MVC 3, using Entity Framework Code
I need help with trying to insert a record using MVC and Entity Framework.
I am using Entity Framework 4.1 with POCOs and DbContext, no proxies no lazy
I am using Entity Framework and when a DbUpdateException is thrown from dbContext.SaveChanges() how
I've recently started using Entity Framework migrations and noticed that the database name is

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.