简体   繁体   English

“do.net”命令什么都不做

[英]"dotnet" command does nothing

I'm trying to install a global package through do.net cli but the command do.net does nothing.我正在尝试通过do.net cli安装全局 package 但命令do.net什么都不做。 I don't get an error message that says the command is not found etc. but it also doesn't run.我没有收到一条错误消息,指出找不到命令等,但它也没有运行。

在此处输入图像描述

Between each line, cursor inside the powershell (or command prompt) turns into Working In Background (在每一行之间,powershell(或命令提示符)内的 cursor 变成Working In Background ( ) mode but after just a few seconds, it just gets into the new line without doing anything. ) 模式,但仅几秒钟后,它就进入了新行而没有做任何事情。 During these few seconds, if I move the cursor outside the prompt, it goes back to regular mode.在这几秒钟内,如果我将 cursor 移到提示之外,它会返回到常规模式。 So it's doing something I guess.所以我猜它正在做某事。

What is happening here, and how can I solve this issue?这里发生了什么,我该如何解决这个问题?


What have I already tried: 我已经尝试过什么:

1-) Since my.network is behind a proxy, I've added the proxy credentials through NPM configuration commands. 1-) 由于 my.network 在代理后面,我已经通过 NPM 配置命令添加了代理凭据。 ( as can be seen here ) (I also set the strict-ssl to false ). 在这里可以看出)(我还将strict-ssl设置为false )。

2-) Since it didn't do anything, I also used this method and edited the global nuget.config file. 2-) 由于它没有做任何事情,我也使用这种方法并编辑了全局nuget.config文件。 But didn't solve any problem.但是没有解决任何问题。

3-) I tried this too, but setting the environment variable MSBuildSDKsPath seems to do nothing about my problem. 3-) 我也试过,但是设置环境变量MSBuildSDKsPath似乎对我的问题没有任何作用。

My PATH variable has these:我的 PATH 变量有这些:

C:\Program Files\do.net , C:\Program Files\do.net ,
%USERPROFILE%\.do.net\tools

I also downloaded the latest Do.net 5.0 SDK and installed it, but nothing.我也下载了最新的Do.net 5.0 SDK 并安装了,但是没有。


Only command that works with do.net is the --list-sdks command which shows this result:唯一适用于do.net的命令是显示此结果的--list-sdks命令:

在此处输入图像描述

I uninstalled all the .NET SDKs and runtimes, I also removed all the installed modules on both VS 2019 and VS 2022 Preview using the Visual Studio Installer, then restarted my computer.我卸载了所有 .NET SDK 和运行时,我还使用 Visual Studio 安装程序删除了 VS 2019 和 VS 2022 预览版上安装的所有模块,然后重新启动了我的计算机。

While installing the SDKs and runtimes from Microsoft's website I checked the .NET version using the command line and command do.net --version after every installation to see when exactly it starts not working.Microsoft 网站安装 SDK 和运行时时,我在每次安装后使用命令行和命令do.net --version检查了 .NET 版本,以查看它何时开始不工作。 After installing all the SDK's up to .NET 5, there was no issue.在安装了所有 SDK 到 .NET 5 之后,没有问题。 And since I did not really need the .NET 6 SDK I didn't specifically download it thinking VS 2022 Preview would automatically install it anyways.而且由于我并不真正需要 .NET 6 SDK 我没有专门下载它认为 VS 2022 预览版无论如何都会自动安装它。

Using Visual Studio Installer, I installed the necessary components for the do.net development on the VS 2019 and the previously mentioned command was working on point.使用 Visual Studio Installer,我在 VS 2019 上安装了 do.net 开发所需的组件,并且前面提到的命令正在运行。 Then I proceeded to install the necessary components on the VS 2022 Preview but after installing it, the command started to not work.然后我继续在 VS 2022 Preview 上安装必要的组件,但在安装它之后,命令开始不起作用。 So there it was, the source of the problem.这就是问题的根源 Something about VS 2022 Preview's installment process just corrupts do.net cli, but I'm not sure if it's just me.关于 VS 2022 Preview 的安装过程的一些事情只是破坏了 do.net cli,但我不确定它是否只是我。

You also need a restart after all the installments or do.net cli might show some errors.您还需要在所有分期付款后重新启动,否则 do.net cli 可能会显示一些错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM