0

Sorry if the question is a bit long. I couldn't figure out how to phrase it any other way.

I recently deployed an application to google cloud via VS 2017 web deploy. And in the settings tabs there is a section where I can specify the database connection string to apply database migration.

Please let me know if I am wrong here but I though this is the destination database where the migration is applied to.

So I have set the same connection string as the database connection string for runtime and clicked on deploy.

Everything seems to be deployed without any error messages. But when I launch the application it came up with error message described in this link:

asp-net-core-deployment-to-iis-error-development-environment-should-not-be-enab

So I followed the instructions and when I browse the page, I get an error message saying that

Applying existing migrations for ApplicationDbContext may resolve this issue

And I see that 'Apply Migrations ' blue button.

My question is , do I have to run the migrations in the command line after this web deployment normally? Or did something go wrong with preparation of the deployment, configuration or something else?

Thanks!

rlee923
  • 758
  • 3
  • 14
  • 28

1 Answers1

0

My question is, do I have to run the migrations in the command line after this web deployment normally?

I think this is normal.

This page describes automatic migrations: https://msdn.microsoft.com/en-us/library/jj554735(v=vs.113).aspx

If I understand it correctly, it's actually Visual Studio that does the migration, so a deployed application will never be able to do the migration itself.

Jeffrey Rennie
  • 3,193
  • 1
  • 18
  • 19
  • Thank you for the answer, I installed SDK on the server and ran dotnet ef update command but doesn't seem to work as expected, so I temporarily gave apppoolidentity permission to run the migration automatically. – rlee923 Sep 26 '17 at 22:22