解决 使用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- ...
随机推荐
- SpringBoot-技术专区-异步编程
最近在实现一个聚合搜索的需求时,由于需要从五个索引中查询数据,然后再将搜索结果组合返回给前端app展现,显然这个地方不能再用同步的方式来操作了,如果有一个索引查询出现耗时较长,那么其余的请求都会排同步 ...
- nginx的原理
Nginx会按需同时运行多个进程:一个主进程(master)和几个工作进程(worker),配置了缓存时还会有缓存加载器进程 (cache loader)和缓存管理器进程(cache manager) ...
- C的基本数据类型小结
代码 /** * 基本数据类型 */ #include <stdio.h> #include <limits.h> /* 定义 32 位时的 long 与 unsigned l ...
- go语言从例子开始之Example14.变参函数
可变参数函数.可以用任意数量的参数调用.例如,fmt.Println 是一个常见的变参函数. Example: package main import "fmt" //...int ...
- nginx的虚拟主机和反向代理和一些技巧应用
前言 nginx是什么,一般用来做反向代理,也可以用来放静态htnl等文件..当然代理tcp协议也没啥问题,但做好是别用哈.性能不咋样. 虚拟主机 什么是虚拟主机? 个人理解,比如一台主机装一个ngi ...
- 带你逐行阅读redux源码
带你逐行阅读redux源码 redux版本:2019-7-17最新版:v4.0.4 git 地址:https://github.com/reduxjs/redux/tree/v4.0.4 redux目 ...
- 【Python CheckiO 题解】SP
题目描述 [Speech Module]:输入一个数字,将其转换成英文表达形式,字符串中的所有单词必须以一个空格字符分隔. [输入]:一个数字(int) [输出]:代表数字的英文字符串(str) [前 ...
- Temporarily disable Ceph scrubbing to resolve high IO load
https://blog.dachary.org/2014/08/02/temporarily-disable-ceph-scrubbing-to-resolve-high-io-load/ In a ...
- QByteArray和十六进制的QString(char*)相互转换
#include <QCoreApplication> #include <QDebug> #include <QDataStream> QByteArray He ...
- springboot-redis相关配置整理
1.pom.xml引入对应数据文件 <dependency> <groupId>org.springframework.boot</groupId> <art ...