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

推荐订阅源

WordPress大学
WordPress大学
T
Threatpost
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
月光博客
月光博客
V
Visual Studio Blog
T
Tailwind CSS Blog
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
Jina AI
Jina AI
J
Java Code Geeks
Martin Fowler
Martin Fowler
大猫的无限游戏
大猫的无限游戏
Recorded Future
Recorded Future
C
Check Point Blog
腾讯CDC
N
Netflix TechBlog - Medium
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
Hacker News: Ask HN
Hacker News: Ask HN
SecWiki News
SecWiki News
博客园 - Franky
Hacker News - Newest:
Hacker News - Newest: "LLM"
N
News | PayPal Newsroom
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Security @ Cisco Blogs
W
WeLiveSecurity
The Last Watchdog
The Last Watchdog
Cloudbric
Cloudbric
F
Full Disclosure
The Cloudflare Blog
Y
Y Combinator Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
S
Schneier on Security
Schneier on Security
Schneier on Security
Spread Privacy
Spread Privacy
L
LINUX DO - 热门话题
AI
AI
N
News and Events Feed by Topic
T
Tor Project blog
P
Palo Alto Networks Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
G
Google Developers Blog

博客园 - 魏巍(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

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

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