我按照本教程

然後呢

Update-Database -Force -Verbose

它表明它升級了桌子。但是會顯示錯誤:

The model backing the 'DbConnection' context has changed 
since the database was created.
Consider using Code First Migrations to update the database
(http://go.microsoft.com/fwlink/?LinkId=238269).

我也試過了

Enable-Migrations -ContextTypeName MvcApplication6.Models.DbConnection

不過它說:

Migrations have already been enabled in project 'MvcApplication6'. 
To overwrite the existing migrations configuration, use the -Force parameter.

我做錯了什麼想法?

一般承認的答案

我在這裡找到了解決方案。

Database.SetInitializer<DbConnection>(null);



許可下: CC-BY-SA with attribution
不隸屬於 Stack Overflow
這個KB合法嗎? 是的,了解原因
許可下: CC-BY-SA with attribution
不隸屬於 Stack Overflow
這個KB合法嗎? 是的,了解原因