ngen.exe alta CPU Windows 10 - Desinstalación de ensamblajes Bucle sin fin

ngen.exe alta CPU Windows 10 - Desinstalación de ensamblajes Bucle sin fin

Cada vez que dejo mi computadora inactiva durante unos minutos, vuelvo y mi Process Explorer muestra que 'ngen.exe' se está ejecutando y ocupa 2 de mis 4 cpus.

Pregunta: ¿Existe alguna forma de desactivar NGEN.exe como tarea en segundo plano?

Me gustaría (como lo hacen muchos otros en Internet) compilar todos los archivos binarios .net a la vez en lugar de que la computadora lo haga "automáticamente" cada vez que la dejo inactiva. Revisé los foros de Microsoft y hasta ahora nadie tiene una respuesta completa a este problema, y ​​muchos tienen los mismos problemas.

Aparentemente, es necesario volver a compilar alguna biblioteca en .net framework y se "atasa" y pone la CPU en alto y se repite una y otra vez.

Acabo de experimentar el mismo problema y hay otro hilo.intenta responderla pero esta incompleta

Regedit de /HKLM/SOFTWARE/Microsoft/Windows/Current Version/RUN no tiene entrada para ejecutar el compilador .net. Algo más debe estar causando que ngen.exe se active.

¿Alguien puede publicar otras ubicaciones que podrían estar provocando la ejecución de esto?

Me gustaría apagarlo como estoy seguro que muchos otros lo harían. También desactivé las actualizaciones automáticas en Windows 10.

ACTUALIZACIÓN: El explorador de procesos dice que esto es lo que se está ejecutando:

"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe" desinstalación "C:\WINDOWS\assembly\NativeImages_v4.0.30319_64\Microsoft.Vf‌​9a08577#\328b1bc4205‌​c08821860805bf5e6c99‌​ e\Microsoft.VisualSt‌ ​udio.Tools.Applicati‌​ons.Hosting.ni.dll" /noroot /LegacyServiceBehavior – Viktor Hace 5 minutos

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe" desinstalación "C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\Presentation‌​Framewo#\7fa93028119‌​b98117acfd5ea18f15c1‌​3\PresentationFram ew‌​trabajo.ni .dll" /noroot /LegacyServiceBehavior – Viktor Hace 4 minutos editar

"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe" desinstalar "C:\WINDOWS\assembly\NativeImages_v2.0.50727_64\Microsoft.PowerShel#\23dfb41f48958215c80bbbc0c9177cb2\Microsoft.PowerShell.Commands.Utility.ni .dll" /noroot /LegacyServiceBehavior

Sigue funcionando una y otra vez. - ese es el resultado del Explorador de procesos. Es extremadamente molesto y parece suceder CADA VEZ que salgo de mi escritorio.

PREGUNTA: parece que estos son procesos legítimos. ¿Alguien conoce una forma de eliminar manualmente esos comandos de desinstalación y compilar el marco .net completamente una vez en lugar de que se repita una y otra vez?

PRUEBAS ACTUALMENTE: eliminé el proceso y ngentask.exe luego fui a Windows\assembly y moví esas carpetas de imágenes nativas a un directorio temporal. Los mantendré informados si vuelve a iniciarse. Lo más probable es que si faltan las carpetas NativeImages, no intente seguir desinstalando esos ensamblados.

Respuesta1

Descargue el script NGEN fácil, ejecútelo como administrador y seleccione la opción 1 para realizar una ejecución ngen completa:

ingrese la descripción de la imagen aquí

Esto lleva mucho tiempo y realiza todas las operaciones ngen pendientes. Después de esto, la cola ngen está vacía y no deberías volver a ver las otras tareas.

(Si el enlace no funciona, copie y pegue el código en un archivo txt y cámbiele el nombre a cmd):

@echo off
title Easy Ngen Runner v5 for '.NET 4.x series' by Burf

"%windir%\system32\reg.exe" query "HKU\S-1-5-19" >nul 2>&1 && (
goto :admincheckok
) || (
echo      -------
echo  *** WARNING ***
echo      -------
echo.
echo.
echo ADMINISTRATOR PRIVILEGES NOT DETECTED!
call :line
echo.
echo.
echo This script must be run with administrator privileges!
echo.
echo To do so, right click on this script and select 'Run As Administrator'
echo.
goto :fin
)

:admincheckok

"%windir%\system32\reg.exe" query "hklm\software\microsoft\Windows NT\currentversion" /v buildlabex >"%temp%\os.txt"
find /i "AMD64" <"%temp%\os.txt">nul
if %errorlevel% equ 0 (set arch=x64) else (set arch=x86)

for /f "tokens=3* delims= " %%G in ('reg query "hklm\software\microsoft\Windows NT\currentversion" /v productname') do (set winv=%%G %%H)
echo %winv%|find /i "Windows 10" >nul
if errorlevel 0 (set w10=1&for /f "tokens=3" %%G in ('reg query "hklm\software\microsoft\Windows NT\currentversion" /v UBR') do (set /a UBR=%%G))
if defined w10 (for /f "skip=2 tokens=3,4,6,7 delims=. " %%G in ('type "%temp%\os.txt"') do (set "win=%winv% %arch% Build %%G.%UBR% {%%I %%J}")
) else (
for /f "skip=2 tokens=3,4,6,7 delims=. " %%G in ('type "%temp%\os.txt"') do (set "win=Legacy %winv% %arch% Build %%G.%%H {%%I %%J}")
)
del "%temp%\os.txt"

if not exist "%windir%\Microsoft.NET\Framework\v4.0.30319" goto :notinstalled

:menu
call :title
echo.
echo 1. Run full Ngen 'update' task
echo.
echo 2. Run standard Ngen 'update' task
echo.
echo 3. Execute queued Ngen items (what Windows does in background)
echo.
echo 4. Visit the 'homepage' of Burf:
echo    (http://1drv.ms/1oVTfju)
echo.
echo 5. Information
echo.
echo 6. Exit
echo.
echo. 
echo.
choice /c 123456 /N /M "Please enter your selection> "
if errorlevel 6 goto :eof
if errorlevel 5 goto :info
if errorlevel 4 start http://1drv.ms/1oVTfju&goto :menu
if errorlevel 3 goto :ngub
if errorlevel 2 goto :ngus
if errorlevel 1 goto :nguf


:info
call :title
echo This script allows your to easily run the .NET Framework tool Ngen
echo (Native Image Generator) program.
echo.
echo The three options in the menu represent the three different methods in
echo which is can be run:
echo Menu option 1 - Recreates all images
echo Menu option 2 - Processes images that have become invalid
echo Menu option 3 - Execute items already in queue to be processed by Windows
echo.
echo Option 1 is really only beneficial after a .NET Framework or a major Windows
echo update has been installed. Option 3 executes those items already in the
echo queue, this just processes the items immediately instead of during idle
echo processor time.
echo.
echo Option 2 should be used for general use, option 1 after a .NET Framework
echo or major Windows update (including Insider Previews), and option 3 is
echo only provided for completeness of this script. It is the 'least useful'.
echo.
echo It makes sense to have queued items processed and native images updated
echo before they are actually required!
echo.
echo.
echo Press any key to return to menu...
pause >nul
goto :menu


:nguf
call :title
echo Running x86 update item task. Some 'errors' may show, this is expected.
call :line
echo.
"%windir%\Microsoft.NET\Framework\v4.0.30319\ngen.exe" update /force
if defined task (
"%windir%\Microsoft.NET\Framework\v4.0.30319\ngentask.exe" /runtimewide
)
echo.
if %arch% equ x86 (goto :nudone)
echo.
echo Now running x64 update item task. Some 'errors' may show, this is expected.
call :line
echo.
"%windir%\Microsoft.NET\Framework64\v4.0.30319\ngen.exe" update /force
if defined task (
"%windir%\Microsoft.NET\Framework64\v4.0.30319\ngentask.exe" /runtimewide
)
goto :nudone


:ngus
call :title
echo Running x86 update item task. Some 'errors' may show, this is expected.
call :line
echo.
"%windir%\Microsoft.NET\Framework\v4.0.30319\ngen.exe" update
if defined task (
"%windir%\Microsoft.NET\Framework\v4.0.30319\ngentask.exe" /runtimewide
)


echo.
if %arch% equ x86 (goto :nudone)
echo.
echo Now running x64 update item task. Some 'errors' may show, this is expected.
call :line
echo.
"%windir%\Microsoft.NET\Framework64\v4.0.30319\ngen.exe" update
if defined task (
"%windir%\Microsoft.NET\Framework64\v4.0.30319\ngentask.exe" /runtimewide
)
goto :nudone


:ngub
call :title
echo Running x86 update item task. Some 'errors' may show, this is expected.
call :line
echo.
"%windir%\Microsoft.NET\Framework\v4.0.30319\ngen.exe" executequeueditems
if defined task (
"%windir%\Microsoft.NET\Framework\v4.0.30319\ngentask.exe" /runtimewide
)


echo.
if %arch% equ x86 (goto :nudone)
echo.
echo Now running x64 update item task. Some 'errors' may show, this is expected.
call :line
echo.
"%windir%\Microsoft.NET\Framework64\v4.0.30319\ngen.exe" executequeueditems
if defined task (
"%windir%\Microsoft.NET\Framework64\v4.0.30319\ngentask.exe" /runtimewide
)
goto :nudone


:nudone
echo.
echo.
echo Done! Please note that some 'errors' may have appeared. These are, for the
echo most part, not unexpected and are not deemed critical.
echo.
goto :fin


:title
cls
echo -----------------------------------------
echo Easy Ngen Runner v5 for '.NET 4.x' series by Burf
echo -----------------------------------------
echo %win%
echo.
goto :eof


:fin
echo.
echo Press any key to exit...
pause >nul
goto :eof


:notinstalled
echo Microsoft .NET Framework 4, 4.5, 4.6, or 4.7 NOT detected. Please install before
echo using this script. If already installed, something may be 'wrong'...
goto :fin


:line
echo ____________________________________________________________________________
goto :eof

Respuesta2

Eliminar una clave en el registro es lo que finalmente funcionó para mí. El problema era que ngen intentaba seguir reasignando memoria una y otra vez para la misma DLL corrupta en el registro. Eventualmente consumiría toda la memoria disponible en la computadora.

Eliminar la clave "\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\v2.0.50727\NGenService\Roots" funcionó para mí. Detener la tarea programada o eliminar ngen.exe es solo una medida temporal y no soluciona el problema.

No entiendo cómo Microsoft pudo permitir que un problema como este continuara durante tanto tiempo. Hoy fue el primer día que una búsqueda resultó en una respuesta para mí.

Puede encontrar más información sobre el problema aquí.https://aloiskraus.wordpress.com/2017/12/13/the-case-of-ngen-exe-needing-50-gb-of-memory/

Respuesta3

Esto funcionó para mí. Ejecuté un análisis de virus después de hacer todo lo que la gente decía en línea y volvió de inmediato. Había un virus en forma de un archivo .dll que tenía el nombre .netframework. Resulta que era un virus de minería de CPU, espero. esto ayuda

información relacionada