我已经使用 IIS10 在我的本地机器上发布了我的 ASP 应用程序。 当我在部署后尝试登录或注册新用户时出现此错误
Unable to update database to match the current model because there are >pending changes and automatic migration is disabled. Either write the pending >model changes to a code-based migration or enable automatic migration. Set >DbMigrationsConfiguration.AutomaticMigrationsEnabled to true to enable >automatic migration.
我使用 visual studio 2013,Entityframework 6.1.3,Windows 身份验证
最佳答案
您需要针对目标数据库运行 Update-Database
。
打开包管理器控制台窗口并选择您的 Entity Framework 项目,然后键入该命令。只要配置指向正确的数据库,它就应该更新它。
PM> Update-Database
Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
No pending explicit migrations.
Running Seed method.
PM>
关于c# - 部署后无法登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39172488/