gpt4 book ai didi

c# - ASP.NET Core CRUD 工具 : command not found but actually installed

转载 作者:行者123 更新时间:2023-12-01 21:47:55 27 4
gpt4 key购买 nike

我正在学习 ASP.net,所以我正在阅读 https://learn.microsoft.com/fr-fr/aspnet/core/tutorials/razor-pages/model?view=aspnetcore-3.0&tabs=visual-studio-code搭建电影模型部分中,我必须安装并运行 CRUD 工具(ASP.net Core dotnet-aspnet-codegenerator)。 我遇到的问题是我无法使用他们的工具,输出错误;不过我可以安装它。以下是详细信息。

所以我按照三步教程来使用这个 CRUD 代码生成器(上面给出的链接)。我引用:

  1. Open a command window in the project directory (The directory that contains the Program.cs, Startup.cs, and .csproj files).

✔ 成功了。

  1. Install the scaffolding tool: dotnet tool install --global dotnet-aspnet-codegenerator

✔ 它有效,现在如果我尝试重新安装它,它会输出它已经安装。

  1. For macOS and Linux: Run the following command: dotnet aspnet-codegenerator razorpage -m Movie -dc RazorPagesMovieContext -udl -outDir Pages/Movies --referenceScriptLibraries

🐛 没用。 这是输出错误:

Could not execute because the specified command or file was not found. Possible reasons for this include: * You misspelled a built-in dotnet command. * You intended to execute a .NET Core program, but dotnet-dotnet-aspnet-codegenerator does not exist. * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

问题:如何调试才能使该命令正常工作?

最佳答案

需要

export PATH=$HOME/.dotnet/tools:$PATH,如 Core MVC ( https://learn.microsoft.com/fr-fr/aspnet/core/tutorials/first-mvc-app/adding-model?view=aspnetcore-3.0&tabs=visual-studio-code ) 所示。 Core Razor 忘记了这一指示。 。 .

关于c# - ASP.NET Core CRUD 工具 : command not found but actually installed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58215952/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com