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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:36:57+00:00 2026-06-04T05:36:57+00:00

We are using Entity Framework 4.3.1’s migrate.exe tool to run database migrations from our

  • 0

We are using Entity Framework 4.3.1’s migrate.exe tool to run database migrations from our TeamCity build server as part of our continuous integration and deployment automation. One of these issues we have been encountering is that the migrate.exe tool does not emit a non-zero exit code when it fails:

C:\<path>\packages\EntityFramework.4.3.1\tools>migrate.exe AppContext /startupdirectory:C:\<path>\bin\Debug /startupconfigurationfile:C:\<path>\Web.config /verbose
<Bunch of successful migrations>
Applying explicit migration: 201202212004585_UpdateTable
VERBOSE: ALTER TABLE [TableA] DROP CONSTRAINT [FK_TableA_TableB]
System.Data.Entity.Migrations.Design.ToolingException: 'FK_TableA_TableB' is not a constraint.
Could not drop constraint. See previous errors.
   at System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner runner)
   at System.Data.Entity.Migrations.Design.ToolingFacade.Update(String targetMig
ration, Boolean force)
   at System.Data.Entity.Migrations.Console.Program.Run()
   at System.Data.Entity.Migrations.Console.Program.Main(String[] args)
ERROR: 'FK_TableA_TableB' is not a constraint.
Could not drop constraint. See previous errors.

C:\<path>\packages\EntityFramework.4.3.1\tools>echo %errorlevel%
0

This is causing Team City to pass a build off as “successful” when a migration fails and it should be failed.

Our temporary work-around is to grep the build log for “ERROR:” and fail the build when this occurs, but this solution is crude and we cannot tell if EF failed or some other process with a similar log entry.

Any suggestions for a better work around? Either a way to make migrate.exe behave or a way to get Team City understand that the failure is specific to migrate.exe.

  • 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-04T05:36:58+00:00Added an answer on June 4, 2026 at 5:36 am

    http://blogs.msdn.com/b/adonet/archive/2012/05/15/ef5-release-candidate-available-on-nuget.aspx

    This release also includes fixes for the following bugs found in Beta 2:

    • …
    • Migrations: Migrate.exe does not set error code after a failure
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Entity Framework code first and pulling some data back from our database.
I am using Entity Framework Code First. I want to query entites from database
I've recently started using Entity Framework migrations and noticed that the database name is
Using Entity Framework Migrations (Beta1), using Update-Database command is all good during development. But
Using Entity Framework 4 with stored procedures and SQL Server 2008 SP1... When running
I'm using entity framework to connect with the database. I've one little problem: I've
I'm using Entity Framework (1st time) on a SQL 2005 database for a data
I am using Entity Framework from .NET 3.5 I have two tables with 0-1
I have been using Entity Framework 4.3 on an existing database and I have
When using Entity Framework 4, how do you create a single entity from a

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.