Abi P
Abi P

Reputation: 1450

Publish fails when I select Execute Code Migrations and Have Config transformation enabled

I have enabled config file transformation for deployment. When I am trying to select the Execute Code first migrations and select the update database option and also select a sql ddata script the publish fails with the following error.

Web deployment task failed. (The value '' is not a valid connection string or an absolute path. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_INVALID_CONNECTION_STRING.)

And also when I open the publish profile again to republish I dont see the Update database option again. This is something surprising.

Has any one faced anything like this?

Upvotes: 0

Views: 62

Answers (1)

Draco
Draco

Reputation: 11

If you have multiple projects in your solution, code first migrations maybe searches in the wrong project for the connection string. Make sure the selected startup project has the right connection string in the app.config. Its not necessarily the project that contains your migration script.

Upvotes: 1

Related Questions