Add-Migration 命令仅提示“ScriptHalted"

Add-Migration command only prompt quot;ScriptHaltedquot;(Add-Migration 命令仅提示“ScriptHalted)
本文介绍了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"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)