问题:
我遇到了dotnet命令的问题,这是我之前从未见过的:当我运行任何dotnet命令(甚至是dotnet --info
时),该过程都需要花费几分钟的时间才能完成,并在其上产生数千行输出一台特定的机器。我已经在Visual Studio 2017、2019预览版和命令提示符中尝试了此操作,并获得了相同的结果。我也尝试过使用-v q或-v m标志手动设置详细程度,但这没有什么区别。
我相信,当我初次设置.net core时,我设置了某种类型的诊断或跟踪标志来导致这种现象,但是我不知道如何禁用它。我在运行核心的笔记本电脑上没有看到相同的问题。我现在使用笔记本电脑实际编译这些构建,因为在我的更强大的主开发计算机上,即使对于使用dotnet new
创建的默认项目,每个构建都需要20分钟以上的时间。
例如,一个dotnet --info
命令花费了4:50,并在这台机器上产生了6,937行输出。
我尝试过的事情: -尝试使用Visual Studio 2017、2019预览版和命令提示符 -使用安静或最小详细程度标志 -重新安装Net Core
环境: Win7 x64 Net Core版本1.0-2.2.1
这完全是我启动dotnet --info
命令时看到的输出。在其他机器上,此命令需要几秒钟才能运行,但是在这台机器上,则需要5分钟以上的时间,并且需要数千行的输出。首先,这只是前290行。开头附近的奇怪格式正是它在输出窗口中的显示方式。
解决方案: 我希望其他人以前已经见过此行为,并且可以指出正确的方向以关闭此跟踪/诊断类型输出。
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
答案 0 :(得分:1)
您似乎已设置了跟踪环境变量。尝试从Powershell
$env:COREHOST_TRACE=0
,然后重新运行dotnet --info
。