.Net Core-使用ANY dotnet命令可产生数千行输出,并且需要花费几分钟才能运行 [英] .Net Core - Using ANY dotnet command produces thousands of lines of output and takes several minutes to run

查看:84
本文介绍了.Net Core-使用ANY dotnet命令可产生数千行输出,并且需要花费几分钟才能运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:
我遇到了dotnet命令的问题,以前在其他任何地方都没见过:当我运行任何dotnet命令时,甚至 dotnet --info ,此过程需要几分钟才能完成,并且在一台特定计算机上会产生数千行输出。我已经在Visual Studio 2017、2019预览版和命令提示符中尝试了相同的结果。我也尝试过使用-v q或-v m标志手动设置详细程度,但这没什么区别。

Issue: I've been having an issue with the dotnet command that I haven't seen anywhere else before: When I run any dotnet command, even dotnet --info, the process takes several minutes to complete and produces thousands of lines of output on one specific machine. I've tried this in Visual Studio 2017, 2019 preview, and in the command prompt with the same results. I've also tried to manually set the verbosity using the -v q or -v m flags, but it makes no difference.

我相信,当我初次设置.net core时,我设置了某种类型的诊断或跟踪标志,导致了这种现象,但是我可以不知道如何禁用它。我的笔记本电脑也运行核心,但看不到相同的问题。现在,我使用笔记本电脑实际编译构建版本,因为在我的更强大的主开发计算机上,每次构建都需要20分钟以上的时间,即使对于使用 dotnet new 创建的默认项目也是如此。 。

I believe that somewhere along the line when I was first setting up .net core, I set some type of diagnostic or tracing flag which has caused this behavior, but I can't figure out how to disable it. I don't see the same issues on my laptop which is also running core. I now use the laptop to actually compile the builds since every build takes 20+ minutes on my main, more powerful, development machine, even for default projects that are created with dotnet new.

例如, dotnet --info 命令花费了4:50,在该命令上产生了6,937行输出机。

As an example, a dotnet --info command took 4:50 and produced 6,937 lines of output on this machine.

我尝试过的事情:
-尝试使用Visual Studio 2017、2019预览版和命令提示符
-使用安静或最小详细程度标志
-重新安装Net Core

Things I've tried: - Trying on Visual Studio 2017, 2019 preview, and the command prompt - Using Quiet or Minimal verbosity flags - Reinstalling Net Core

环境:
Win7 x64
Net核心版本1.0-2.2.1

Environment: Win7 x64 Net Core versions 1.0 - 2.2.1

这完全是我启动 dotnet --info 命令。在其他机器上,此命令需要几秒钟才能运行,但是在这台机器上,则需要5分钟以上的时间,并且需要数千行的输出。首先,这只是前290行。开头附近的奇怪格式正是它在输出窗口中的显示方式。

This is verbatim the output I'm seeing when I start the dotnet --info command. On other machines, this command takes seconds to run, however on this one machine, it takes upwards of 5 minutes and thousand of lines of output. To give an idea, this is just the first 290 lines. The strange formatting near the beginning is exactly how it appears in the output window.

分辨率:
我希望其他人以前已经看到过这种行为,可能会指出正确的方向以关闭此跟踪/诊断类型的输出。

Resolution: I'm hoping someone else has seen this behavior before and could point me in the right direction to turn off this tracing / diagnostic type output.

M> dotnet -info
dotnet : Tracing enabled
At line:1 char:1
+ dotnet -info
+ ~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Tracing enabled:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

--- Invoked dotne
t
 [ve
rsio
n: 2
.2.1
, comm
it has
h: 8
78dd
11e622
3286
5aec731fc9160
4c52c4
ecaf
cf] main = {
C:\Program Files\dotnet\dotnet.ex
e


-
i
n
f
o


}


R
e
adin
g fx res
olver 
directory=[
C:\Program
 Files\do
tnet\h
ost\fxr]


C
onsidering 
fxr v
ersion
=[1.0
.5]..
.

Conside
ring f
xr ver
sion=[
1.1.0]...

Considering 
fxr vers
ion=[1.1.
2]...

Consid
ering fx
r vers
ion=[2
.0.3]...

Consideri
ng fx
r versio
n=[2.0.5]..
.
Consid
ering fxr
 versio
n=[2.0.6].
..

Consi
derin
g fxr
 version
=[2.
0.9]..
.
Con
sideri
ng fxr version=[2.1.0]...
Consi
dering
 fxr v
ersion
=[2.1.3]..
.
Consi
dering f
xr vers
ion=[2
.1.5].
..
Consi
derin
g fxr ve
rsion=
[2.1.
7]...

Con
sider
ing fxr version=[2.1.8]...
Considering fxr version=[2.2.1]...

Detected la
test 
fxr version=[C:\Program 
Files\dot
net\host\
fxr\2.2.1]...

R
esolved fxr [C:\Program Files\dotnet\host\fxr\2.2.1\hostfxr.dll]...

L
oaded library from C:\Prog
ram F
iles\
dotnet\host\fxr\2.2.1\hostfxr.dll
Invoking fx resolver [C:\Program Files\dotnet
\host
\fxr\2.2.1\
hostfxr.dll
] v2

Host path: [C:\Prog
ram Fil
es\dotnet\dot
net.exe
]
Dotn
et pat
h: [C:\Program Files\dotnet\
]
App 
path: 
[C:\P
rogram
 Files
\dotne
t\dotnet.dll
]

Trac
ing enabled
--- I
nvoked hostfxr
 v2 [commit hash: 878dd11e62232865aec731fc91604c52c4ecafcf] main
Checking if CoreCLR path exists=[C:\Program Files\dotnet\coreclr.dll]
--- Executing in muxer mode...
Using the provided arguments to determine the application to execute.
Application '-info' is not a managed executable.
--- Resolving dotnet from working dir
Probing path [Redacted\global.json] for global.json
Probing path [Redacted\global.json] for global.json
Probing path [Redacted\global.json] for global.json
Probing path [Redacted\global.json] for global.json
Probing path [Redacted\global.json] for global.json
Terminating global.json search at [G:\]
Searching SDK directory in [C:\Program Files\dotnet\]
--- Resolving SDK version from SDK dir [C:\Program Files\dotnet\sdk]
Considering version... [1.0.0-preview1-002702]
Considering version... [1.0.0-preview2-003121]
Considering version... [1.0.0-preview2-003131]
Considering version... [1.0.0-preview2-1-003177]
Considering version... [1.0.4]
Considering version... [1.1.0]
Considering version... [2.0.3]
Considering version... [2.1.103]
Considering version... [2.1.2]
Considering version... [2.1.200-preview-007474]
Considering version... [2.1.202]
Considering version... [2.1.300]
Considering version... [2.1.4]
Considering version... [2.1.401]
Considering version... [2.1.403]
Considering version... [2.1.504]
Considering version... [2.1.600-preview-009472]
Considering version... [2.1.600-preview-009497]
Considering version... [2.2.103]
Considering version... [2.2.200-preview-009748]
Considering version... [2.2.200-preview-009804]
Considering version... [NuGetFallbackFolder]
Checking if resolved SDK dir [C:\Program Files\dotnet\sdk\2.2.200-preview-009804] exists
Resolved SDK dir is [C:\Program Files\dotnet\sdk\2.2.200-preview-009804]
Searching SDK directory in [C:\Program Files\dotnet]
--- Resolving SDK version from SDK dir [C:\Program Files\dotnet\sdk]
Considering version... [1.0.0-preview1-002702]
Considering version... [1.0.0-preview2-003121]
Considering version... [1.0.0-preview2-003131]
Considering version... [1.0.0-preview2-1-003177]
Considering version... [1.0.4]
Considering version... [1.1.0]
Considering version... [2.0.3]
Considering version... [2.1.103]
Considering version... [2.1.2]
Considering version... [2.1.200-preview-007474]
Considering version... [2.1.202]
Considering version... [2.1.300]
Considering version... [2.1.4]
Considering version... [2.1.401]
Considering version... [2.1.403]
Considering version... [2.1.504]
Considering version... [2.1.600-preview-009472]
Considering version... [2.1.600-preview-009497]
Considering version... [2.2.103]
Considering version... [2.2.200-preview-009748]
Considering version... [2.2.200-preview-009804]
Considering version... [NuGetFallbackFolder]
Checking if resolved SDK dir [C:\Program Files\dotnet\sdk\2.2.200-preview-009804] exists
Resolved SDK dir is [C:\Program Files\dotnet\sdk\2.2.200-preview-009804]
Found CLI SDK in: C:\Program Files\dotnet\sdk\2.2.200-preview-009804
Using dotnet SDK dll=[C:\Program Files\dotnet\sdk\2.2.200-preview-009804\dotnet.dll]
Using the provided arguments to determine the application to execute.
Using dotnet root path [C:\Program Files\dotnet\]
App runtimeconfig.json from [C:\Program Files\dotnet\sdk\2.2.200-preview-009804\dotnet.dll]
Runtime config is cfg=C:\Program Files\dotnet\sdk\2.2.200-preview-009804\dotnet.runtimeconfig.json dev=C:\Program Files\dotnet\sdk\2.2.200-preview-009804\dotnet.runtimeconfig.dev.json
Attempting to read runtime config: C:\Program Files\dotnet\sdk\2.2.200-preview-009804\dotnet.runtimeconfig.json
Attempting to read dev runtime config: C:\Program Files\dotnet\sdk\2.2.200-preview-009804\dotnet.runtimeconfig.dev.json
Runtime config [C:\Program Files\dotnet\sdk\2.2.200-preview-009804\dotnet.runtimeconfig.json] is valid=[1]
--- Resolving FX directory, name 'Microsoft.NETCore.App' version '2.2.1'
Searching FX directory in [C:\Program Files\dotnet]
Attempting FX roll forward starting from [2.2.1]
'R
oll forward on no candidate fx' enabled with value [1]. Looking for the least production greater than or equal to [2.2.1]
Found version [2.2.1]
Applying patch roll forward from [2.2.1]
Inspecting version... [1.0.0]
Inspecting version... [1.0.0-rc2-3002702]
Inspecting version... [1.0.1]
Inspecting version... [1.0.5]
Inspecting version... [1.1.0]
Inspecting version... [1.1.2]
Inspecting version... [2.0.3]
Inspecting version... [2.0.5]
Inspecting version... [2.0.6]
Inspecting version... [2.0.9]
Inspecting version... [2.1.0]
Inspecting version... [2.1.3]
Inspecting version... [2.1.5]
Inspecting version... [2.1.7]
Inspecting version... [2.1.8]
Inspecting version... [2.2.1]
Changing Selected FX version from [] to [C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.1]
Chose FX version [C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.1]
Runtime config is cfg=C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.1\Microsoft.NETCore.App.runtimeconfig.json dev=C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.1\Microsoft.NETCore.App.runtimeconfig.dev.json
Attempting to read runtime config: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.1\Microsoft.NETCore.App.runtimeconfig.json
Attempting to read dev runtime config: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.1\Microsoft.NETCore.App.runtimeconfig.dev.json
Runtime config [C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.1\Microsoft.NETCore.App.runtimeconfig.json] is valid=[1]
Executing as a framework-dependent app as per config file [C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.1\Microsoft.NETCore.App.runtimeconfig.json]
--- Resolving hostpolicy.dll version from deps json [C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.1\Microsoft.NETCore.App.deps.json]
Resolved version 2.2.1 from dependency manifest file [C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.1\Microsoft.NETCore.App.deps.json]
Did not find hostpolicy.dll in directory C:\Program Files (x86)\coreservicing\pkgs\runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy\2.2.1\runtimes\win-x64\native
The expected hostpolicy.dll directory is [C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.1]
Loaded library from C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.1\hostpolicy.dll
Tracing enabled
Reading from host interface version: [0x16041101:240] to initialize policy version: [0x16041101:240]
--- Invoked hostpolicy [commit hash: 878dd11e62232865aec731fc91604c52c4ecafcf] [runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy,2.2.1,runtimes/win-x64/native][x64] main = {
C:\Program Files\dotnet\dotnet.exe
C:\Program Files\dotnet\sdk\2.2.200-preview-009804\dotnet.dll
-info
}
Deps file: 
-- arguments_t: host_path='C:\Program Files\dotnet\dotnet.exe' app_root='C:\Program Files\dotnet\sdk\2.2.200-preview-009804\' deps='C:\Program Files\dotnet\sdk\2.2.200-preview-009804\dotnet.deps.json' core_svc='C:\Program Files (x86)\coreservicing' mgd_app='C:\Program Files\dotnet\sdk\2.2.200-preview-009804\dotnet.dll'
-- arguments_t: dotnet shared store: 'C:\Program Files\dotnet\store\x64\netcoreapp2.2'
-- arguments_t: global shared store: 'C:\Program Files\dotnet\store\x64\netcoreapp2.2'
Using Fx C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.1\Microsoft.NETCore.App.deps.json deps file
Loading deps file... C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.1\Microsoft.NETCore.App.deps.json as framework dependent=[0]
Adding runtime asset runtimes/win-x64/lib/netcoreapp2.2/Microsoft.CSharp.dll assemblyVersion=4.0.4.0 fileVersion=4.6.27207.3 from runtime.win-x64.Microsoft.NETCore.App/2.2.1
Adding runtime asset runtimes/win-x64/lib/netcoreapp2.2/Microsoft.VisualBasic.dll assemblyVersion=10.0.4.0 fileVersion=4.6.27207.3 from runtime.win-x64.Microsoft.NETCore.App/2.2.1
Adding runtime asset runtimes/win-x64/lib/netcoreapp2.2/Microsoft.Win32.Primitives.dll assemblyVersion=4.1.1.0 fileVersion=4.6.27207.3 from runtime.win-x64.Microsoft.NETCore.App/2.2.1
Adding runtime asset runtimes/win-x64/lib/netcoreapp
2.2/Microsoft.Win32.Registry.dll assemblyVersion=4.1.1.0 fileVersion=4.6.27207.3 from runtime.win-x64.Microsoft.NETCore.App/2.2.1


推荐答案

似乎已设置了跟踪环境变量。尝试从 Powershell

It looks like you have a trace environment variable set. Try running this from Powershell

$env:COREHOST_TRACE=0

然后重新运行 dotnet --info

这篇关于.Net Core-使用ANY dotnet命令可产生数千行输出,并且需要花费几分钟才能运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆