惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

博客园 - 魏巍(QQ:68235081)

.Net Core实战教程(三):使用Supervisor配置守护进程 .Net Core实战教程(二):设置Kestrel的IP与端口的几种方法 .Net Core实战教程(一):Linux下搭建项目 关于.Net Core 前后端分离跨域请求时 ajax并发请求导致部分无法通过验证解决办法。 windows 2012 IIS 部署 .net core HTTP Error 502.5 - Process Failure 错误解决办法 sqlserver 删除所有记录后,让自增列从1开始 .Net Core 给WebApi接口返回值添加全局的日期格式化 Message "'OFFSET' 附近有语法错误。 在 FETCH 语句中选项 NEXT 的用法无效。" 解决办法 EntityFrameworkCore 关于.Net Core 部署在Linux下连接SqlServer数据库超时解决办法 vs2017添加引用提示“找不到 Microsoft.VisualStudio.Shell.Interop.IVsReferenceManager 服务的实例”解决方案 在.Net Core中使用Swagger制作接口文档 发布mvc遇到的HTTP错误 403.14-Forbidden解决办法 如何在.Net Mvc中让Get,Post请求访问同一个Action的方法 jquery中attr和prop的区别 WebApi验证 解决Code First MySql数据库 Specified key was too long; max key length is 767 bytes异常 【转】Unobtrusive Ajax的使用 jquery.validate.unobtrusive的使用 企业库判断数据库连接类型
EntityFrameworkCore Db First 生成Model时出错 PowerShell 版本过低
魏巍(QQ:68235081) · 2017-11-09 · via 博客园 - 魏巍(QQ:68235081)

一般Windows7默认安装的是PowerShell 2.0

使用Vs2017开发.Net Core时。使用 EntityFrameworkCore Db First自动生成实体时需要用到下面命令:

Scaffold-DbContext "Server=localhost;Database=SunnyTask;UID=sa;PWD=Kingsun2008" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Database\Models

如果PowerShell 2.0会出一个版本过低的错误,导致无法生成实体。

所以我们要升级PowerShell 

升级方法:

在微软官方地址下载PowerShell 3.0 安装。

https://www.microsoft.com/en-us/download/details.aspx?id=34595

Windows7 64位下载:Windows6.1-KB2506143-x64.msu

成功下载安装后,重启电脑。

开机后再运行命令即可生成实体。