“Execute Code First Migrations” checkbox disappeared from my publish profile

前端 未结 6 712
逝去的感伤
逝去的感伤 2020-12-15 23:17

I\'m using web deploy to deploy an MVC4 application using EF5 code first. I made a publish profile called \"development\" that uses web deploy for application and database u

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-16 00:01

    Here is the right answer - is solved the problem for me. Just rename your connection string exactly as your DbContext, e.g.

            public ApplicationDbContext()
            : base("Vocabulary.Domain.ApplicationDbContext", throwIfV1Schema: false)
        {
        }
    

    Note that name should include namespace like "Vocabulary.Domain.ApplicationDbContext". Don't forget to update .pubxml files:

        
    

    This article describes when publish dialog has or has no the tick "Execute Code First Migrations (runs on application start)"

提交回复
热议问题