解决 使用migrations 执行update-database 出现System.InvalidOperationException: 实例失败的问题
好久没有使用Code First的方式来创建模型了 今天重温了一下 但是出现了很多问题
现在总结一下
在我做完初期的操作的之后,使用 update-database -verbose 更新数据库时,始终出现System.InvalidOperationException: 实例失败的问题

很是恼火,网上找了很多的解决方案始终不行。但是觉得是我的连接字符串的问题
连接字符串如下
<add name="ProDBContext" connectionString="Data Source=DESKTOP-HFNNE8J\\C_SUPREME;Initial Catalog=ProComment;Persist Security Info=True;User ID=sa;Password=******;" providerName="System.Data.SqlClient"/>
这里的Data Source 有两个\ 这个,是因为我以前用sql语句去连接数据库的时候 就是两个\一个的话会出现转义失败的问题。
但是,今天的实例失败就是这个转义字符的原因。我删除掉一个\ 转移符号之后就执行成功了
说明migrations 可以自动识别转义字符
解决 使用migrations 执行update-database 出现System.InvalidOperationException: 实例失败的问题的更多相关文章
- ABP 报错 System.InvalidOperationException: 实例失败。
错误:System.InvalidOperationException: 实例失败. 解决:数据库链接写错了,斜杠的问题 core:两根斜杠 .net framework:一根斜杠 core的写法: ...
- EF框架CodeFirst the model backing the 'PModelEntities' context has changed since the database was created. Consider using Code First Migrations to update the database
1.采用code first 做项目时,数据库已经生成,后期修改数据库表结构.再次运行时出现一下问题: Entity Framework : The model backing the 'Produc ...
- oracle执行update时卡死问题的解决办法
原因: 由于在PLSQL Developer执行update时没有commit,oracle将该条记录锁住了. 可以通过以下办法解决: 先查询锁定记录 Sql代码 SELECT s.sid, s.se ...
- oracle执行update语句时卡住问题分析及解决办法
转载:http://www.jb51.net/article/125754.htm 这篇文章主要介绍了oracle执行update语句时卡住问题分析及解决办法,涉及记录锁等相关知识,具有一定参考价值, ...
- mysql执行update报错1175解决方法
mysql执行update报错 update library set status=true where 1=1 Error Code: 1175. You are using safe update ...
- Ubuntu 解决:当执行`sudo apt-get update`命令时 出现的 “apt-get 404 Not Found Package Repository Errors” 问题
Ubuntu 解决:当执行sudo apt-get update或者sudo apt-get install命令是出现的 "apt-get 404 Not Found Package Rep ...
- mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY
mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY 今天开发的同事发来如下错误信息,最最简 ...
- svn执行update操作后出现:Error : Previous operation has not finished; run 'cleanup' if it was interrupted.
svn执行update操作后出现: Error : Previous operation has not finished; run 'cleanup' if it was interrup ...
- maven执行update命令时报org/apache/maven/shared/filtering/MavenFilteringException错误
原 maven执行update命令时报org/apache/maven/shared/filtering/MavenFilteringException错误 在eclipse中对准项目执行maven- ...
随机推荐
- LNMP环境安装
一.LNMP 1.使用LNMP的优点: 资源占用少 更多并发 代理服务器 热启动 稳定高效 负载均衡 邮件服务器 2.安装前准备: 2.1查看防火墙(默认开启): [root@localhost ~] ...
- Quartz -----定时任务框架
一.什么是Quartz 由java开发用来执行定时任务,类似于java.util.Timer. 但是相较于Timer,quartz增加了很多功能: 持久性 ...
- 【leetcode】948. Bag of Tokens
题目如下: You have an initial power P, an initial score of 0 points, and a bag of tokens. Each token can ...
- Delphi 格式化函数 Format函数
function Format(const Format: string; const Args: array of const): string; function Format(const For ...
- 新手指南:DVWA-1.9全级别教程之SQL Injection
*本文原创作者:lonehand,转载须注明来自FreeBuf.COM 目前,最新的DVWA已经更新到1.9版本(http://www.dvwa.co.uk/),而网上的教程大多停留在旧版本,且没有针 ...
- Angular项目中引入jQuery
npm install --save jquery npm install @types/jquery --save 在对应的组件中引入 import * as $ from "jquery ...
- 小程序 页面传值 json 被截断
因此解决这个报错的方法是将要传输的数据用 encodeURIComponent()函数(可把字符串作为 URI 组件进行编码) 先进行编码, 传输过去后再通过decodeURIComponent()函 ...
- Ruby 技能图谱
# Ruby 技能图谱 说明: 本图谱只捡重点的列举,并非包含全部.文中所列举或没有列举的资源信息都可以在[awesome-ruby](https://github.com/markets/aweso ...
- HTML5: 目录
ylbtech-HTML5: 目录 1.返回顶部 1. http://www.runoob.com/html/html5-intro.html 2. http://www.w3school.com.c ...
- (3)C++复合类型
存储数据时必须跟踪的三个属性:信息储存在何处,存储的值,存储的类型 一.数组 #include <iostream> using namespace std; int main() { / ...