title: Entity Framework 4.3.1 Migrate.exe non-zero exit code
body: <p>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:</p>
  
  <pre><code>C:\&lt;path&gt;\packages\EntityFramework.4.3.1\tools&gt;migrate.exe AppContext /startupdirectory:C:\&lt;path&gt;\bin\Debug /startupconfigurationfile:C:\&lt;path&gt;\Web.config /verbose
  &lt;Bunch of successful migrations&gt;
  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:\&lt;path&gt;\packages\EntityFramework.4.3.1\tools&gt;echo %errorlevel%
  0
  </code></pre>
  
  <p>This is causing Team City to pass a build off as "successful" when a migration fails and it should be failed. </p>
  
  <p>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.</p>
  
  <p>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.</p>