MVC中“The model backing the '***Context' context has changed since the database was created. ”的问题处理
2014-08-28 17:47
597 查看
本来不是什么大事,但这个问题确实困扰了我一天。
事情大致的经过是这样的:项目需要增加一个问题处理的模块,因为功能相对简单就手动写了Model和一个空的Controller,没有通过构造器处理,后来因为代码拷贝的原因,Model中显示的Context多了一个,当运行项目的时候就开始报错了。后来发现在这个问题,就把所有新加的全部拿掉,可是问题依旧,此时就百度、BING中搜索,都是让重新构建EF,SHIT,如是做了,问题依旧,事后想想应当不会如此严重,就开始测试,首先将EF操作数据库的方法改成自己的数据库连接类处理,没有问题,一切正常。在另外一个模块中使用EF来连,还是不行,想想EF并没有动过,这时才开始想到仔细检查数据库字段,在此过程中发现系统表中居然多了一个莫名的表,删除此,重新运行一切OK。
事情大致的经过是这样的:项目需要增加一个问题处理的模块,因为功能相对简单就手动写了Model和一个空的Controller,没有通过构造器处理,后来因为代码拷贝的原因,Model中显示的Context多了一个,当运行项目的时候就开始报错了。后来发现在这个问题,就把所有新加的全部拿掉,可是问题依旧,此时就百度、BING中搜索,都是让重新构建EF,SHIT,如是做了,问题依旧,事后想想应当不会如此严重,就开始测试,首先将EF操作数据库的方法改成自己的数据库连接类处理,没有问题,一切正常。在另外一个模块中使用EF来连,还是不行,想想EF并没有动过,这时才开始想到仔细检查数据库字段,在此过程中发现系统表中居然多了一个莫名的表,删除此,重新运行一切OK。
相关文章推荐
- The model backing the <Database> context has changed since the database was created.
- EF Code First(提示The model backing the '***' context has changed since the database was created.)
- The model backing the 'ProductContext' context has changed since the database was created. EF6
- Additional information: The model backing the 'StuInfoDBContext' context has changed since the datab
- The model backing the 'XXX' context has changed 错误
- 解决问题:The context cannot be used while the model is being created
- selenium+python自动化88-批量操作循环点击报错:Element not found in the cache - perhaps the page has changed since it was looked up
- 解决webdriver(Element not found in the cache - perhaps the page has changed since it was looked up )
- selenium Element not found in the cache - perhaps the page has changed since it was looked up接解决
- Model backing a DB Context has changed; Consider Code First Migrations
- Webdriver如何解决页面元素过期:org.openqa.selenium.StaleElementReferenceException: Element not found in the cache - perhaps the page has changed since it was looked up
- The parent virtual disk has been modified since the child was created
- VMWare The parent virtual disk has been modified since the child was created
- The parent virtual disk has been modified since the child was created
- The parent virtual disk has been modified since the child was created
- The project was not built since its build path is incomplete. 问题
- Model compatibility cannot be checked because the database does not contain model metadata. Ensure that IncludeMetadataConvention has been added to the DbModelBuilder conventions
- 处理The content of the adapter has changed but ListView did not receive a notification异常
- 处理The content of the adapter has changed but ListView did not receive a notification异常
- No context type was found in the assembly--------MVC