【问题标题】:'dotnet' is not recognized as the name of a cmdlet, function, script file, or operable program'dotnet' 未被识别为 cmdlet、函数、脚本文件或可运行程序的名称
【发布时间】:2021-07-19 15:27:47
【问题描述】:

我正在尝试向我的用户表添加新字段。

当我运行Add-Migration newMigration 时,出现以下错误。

由于首选项变量“ErrorActionPreference”或公共参数设置为 Stop,正在运行的命令停止:术语“dotnet”未被识别为 cmdlet、函数、脚本文件或可运行程序的名称。 检查名称的拼写,或者如果包含路径,请验证路径是否正确并重试。

ApplicationUser.cs

using System;

using Microsoft.AspNetCore.Identity;

namespace fublight_server.Authentication
{
    public class ApplicationUser:IdentityUser
    {
        public string FirstName { get; set; } // new field
        public string LastName { get; set; } // new field
    }
}

【问题讨论】:

    标签: sql-server .net-core


    【解决方案1】:

    尝试查看是否可以在命令提示符下使用 dotnet --version。如果它给您同样的错误,您很可能必须将“C:\Program Files\dotnet”添加到系统路径变量中才能“找到”命令:

    更改环境变量后可能需要重新启动。

    【讨论】:

    • 如何在 MacOs 中实现
    • “路径变量 macos”的快速谷歌会告诉你 :) 我不确定是否需要,我从未将 MacOs 与 .NET 一起使用。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-03-30
    • 2021-06-09
    • 2016-06-19
    • 2021-11-01
    • 2021-05-23
    • 2020-11-21
    • 1970-01-01
    相关资源
    最近更新 更多