Running update-database from Team City Running update-database from Team City asp.net asp.net

Running update-database from Team City


migrate.exe is what I was looking for, it is found in "packages\EntityFramework.4.3.1\tools".

Add a new build step in Team City using:

Runner type: command line

Command executable: packages\EntityFramework.4.3.1\tools\migrate.exe

Command parameters: MyApplicationName /StartupDirectory:MyApplicationName\bin


Install Entity Framework nuget to the repo and use the accompanying migrate.exe under packages\EntityFramework.5.0.0\tools\ or equivalent.

Then run a batch script like this:

SET AssemblyName=MyMvc4AppSET StartUpDirectory=MyMvc4App\bin\SET ConnectionString=Server=tcp:XXXX.database.windows.net,1433;Database=XXXX;User ID=XXXX;Password=XXXX;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;MultipleActiveResultSets=TrueSET ConnectionStringProvider=System.Data.SqlClientSET ConfigFilePath=%CD%\MyMvc4App\web.configSET MigrateExe=packages\EntityFramework.5.0.0\tools\migrate.exe%MigrateExe% %AssemblyName%.dll /startUpDirectory:%StartUpDirectory% /startUpConfigurationFile:"%ConfigFilePath%" /connectionProviderName:"%ConnectionStringProvider%" /connectionString:"%ConnectionString%" /verbosepause

I answered a similar question and there I explain why I have yet to get it working without specifying a web/app.config file.