Add-Migration command only prompt quot;ScriptHaltedquot;(Add-Migration 命令仅提示“ScriptHalted)
问题描述
我正在尝试使用本教程学习如何使用 Razor 页面制作 App.Net Core 应用程序:https://docs.microsoft.com/en-us/aspnet/core/tutorials/razor-pages/model?view=aspnetcore-3.0&tabs=visual-studio
I'm trying to learn how to make App.Net Core application using Razor pages, using this tutorial : https://docs.microsoft.com/en-us/aspnet/core/tutorials/razor-pages/model?view=aspnetcore-3.0&tabs=visual-studio
在我制作好Movie模型并搭建成功后,我尝试进行数据库的初始迁移.
After I made the Movie model and scaffold it successfully, I try to make the initial migration of the database.
但是,每次我使用命令 Add-Migration
时,它只会提示 ScriptHalted
,即使使用详细选项时,与 Update- 相同数据库
.
However, every time I'm using the command Add-Migration
, it just prompts ScriptHalted
, even when using the verbose option, same with Update-Database
.
我尝试了其他命令,例如 Enable-Migration
,它们似乎可以工作,但不是我需要的两个.
I tried other commands like Enable-Migration
and they seems to work, but not the two I need.
我有什么遗漏吗?
在我看来,我完美地遵循了教程,并试图在这里找到答案,但我没有提出任何解决方案.
It seems to me that I followed the tutorial perfectly, and tried to find an answer here, yet I didn't come up with any solutions.
推荐答案
我在英文教程页面的一个封闭问题中找到了答案(我一开始是用法语的)
I found the answer in a closed question of the english tutorial page (I was using the french one at first)
https://developercommunity.visualstudio.com/content/problem/753703/package-manager-console-scripthalted.html
简单来说,错误来自 Windows 7 使用的旧版本的 PowerShell.现在更新它似乎可以工作了.
In simple, the error was coming from an older version of PowerShell that Windows 7 use. Updating it seems to work now.
这篇关于Add-Migration 命令仅提示“ScriptHalted"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Add-Migration 命令仅提示“ScriptHalted"
基础教程推荐
- 如何激活MC67中的红灯 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- rabbitmq 的 REST API 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01