Migration命令仅在提示时提示

Migration命令仅在提示时提示

本文介绍了Add-Migration命令仅在提示时提示"ScriptHalted".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用本教程来学习如何使用Razor页面制作App.Net Core应用程序: https://docs.microsoft.com/zh-CN/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 时,即使使用verbose选项,它也会提示 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".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 17:59