c# - 部署后无法登录

标签 c# asp.net entity-framework

我已经使用 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/

相关文章:

c# - MVC - 有没有办法在模型中声明具有相同属性、不同名称的多个属性

asp.net - Eval 和 ItemDataBound 或 RowDataBound 事件显示数据,哪个更好?

c# - 为动态连接字符串设置 Entity Framework

c# - EF在集合中显式加载集合

c# - 在 EF Code First 中过滤导航属性

javascript - Kendo Grid C# - 再次选择当前页面而不刷新数据源

c# - XDocument 读取子元素

c# - 与日志注入(inject)模块一起使用时在 Autofac 中显式解析 ILog

JavaScript 运行时错误 : Unable to get property 'length' of undefined or null reference

javascript - 如何使用javascript从gridview中过滤任何项目