Repository navigation
PowerShell Core is Broken on Windows 7 After the Upgrade to .Net Core 2.0 #3747
Description
PowerShell Core no longer works on Windows 7 after the upgrade to .Net Core 2.0 due to missing API sets that are no longer shipped with .Net Core. The issue appeared between the Alpha.18 and Beta.1 releases. Alpha.18 is the last working release for Windows 7.
Builds after the upgrade will fail with the following message:
c:\Program Files\PowerShell>.\6.0.0-beta.1\powershell.exe
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has
been thrown by the target of an invocation. ---> System.DllNotFoundException: Un
able to load DLL 'api-ms-win-eventing-provider-l1-1-0.dll': The specified module
could not be found. (Exception from HRESULT: 0x8007007E)
at System.Management.Automation.Tracing.EtwActivity.UnsafeNativeMethods.Event
ActivityIdControl(ActivityControlCode controlCode, Guid& activityId)
at System.Management.Automation.Tracing.EtwActivity.GetActivityId()
at Microsoft.PowerShell.UnmanagedPSEntry.Start(String consoleFilePath, String
[] args, Int32 argc)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments,
Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Objec
t[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke
Attr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Management.Automation.PowerShellAssemblyLoadContextInitializer.Init
ializeAndCallEntryMethod(String basePaths, AssemblyName entryAssemblyName, Strin
g entryTypeName, String entryMethodName, Object[] args)
at Microsoft.PowerShell.ManagedPSEntry.Main(String[] args)The issue is greater than this single API set because around 80 API sets are no longer shipped by .Net Core. Here is a comparison between .Net Core 1.6 (6.0.0.16) and .Net Core 2.0 (beta1):
c:\Program Files\PowerShell>dir /s api-*
Volume in drive C has no label.
Volume Serial Number is 9451-5721
Directory of c:\Program Files\PowerShell\6.0.0-beta.1
05/01/2017 08:42 PM 19,136 api-ms-win-core-console-l1-1-0.dll
05/01/2017 08:42 PM 18,112 api-ms-win-core-datetime-l1-1-0.dll
05/01/2017 08:42 PM 18,112 api-ms-win-core-debug-l1-1-0.dll
05/01/2017 08:42 PM 18,624 api-ms-win-core-errorhandling-l1-1-0.dll
05/01/2017 08:42 PM 22,208 api-ms-win-core-file-l1-1-0.dll
05/01/2017 08:42 PM 18,624 api-ms-win-core-file-l1-2-0.dll
05/01/2017 08:42 PM 18,624 api-ms-win-core-file-l2-1-0.dll
05/01/2017 08:42 PM 18,616 api-ms-win-core-handle-l1-1-0.dll
05/01/2017 08:42 PM 18,624 api-ms-win-core-heap-l1-1-0.dll
05/01/2017 08:42 PM 18,616 api-ms-win-core-interlocked-l1-1-0.dll
05/01/2017 08:42 PM 19,136 api-ms-win-core-libraryloader-l1-1-0.dll
05/01/2017 08:42 PM 21,184 api-ms-win-core-localization-l1-2-0.dll
05/01/2017 08:42 PM 19,136 api-ms-win-core-memory-l1-1-0.dll
05/01/2017 08:42 PM 18,624 api-ms-win-core-namedpipe-l1-1-0.dll
05/01/2017 08:42 PM 19,648 api-ms-win-core-processenvironment-l1-1-0.dll
05/01/2017 08:42 PM 20,672 api-ms-win-core-processthreads-l1-1-0.dll
05/01/2017 08:42 PM 19,136 api-ms-win-core-processthreads-l1-1-1.dll
05/01/2017 08:42 PM 18,112 api-ms-win-core-profile-l1-1-0.dll
05/01/2017 08:42 PM 18,616 api-ms-win-core-rtlsupport-l1-1-0.dll
05/01/2017 08:42 PM 18,624 api-ms-win-core-string-l1-1-0.dll
05/01/2017 08:42 PM 20,672 api-ms-win-core-synch-l1-1-0.dll
05/01/2017 08:42 PM 19,136 api-ms-win-core-synch-l1-2-0.dll
05/01/2017 08:42 PM 19,648 api-ms-win-core-sysinfo-l1-1-0.dll
05/01/2017 08:42 PM 18,624 api-ms-win-core-timezone-l1-1-0.dll
05/01/2017 08:42 PM 18,624 api-ms-win-core-util-l1-1-0.dll
05/01/2017 08:42 PM 19,648 api-ms-win-crt-conio-l1-1-0.dll
05/01/2017 08:42 PM 22,720 api-ms-win-crt-convert-l1-1-0.dll
05/01/2017 08:42 PM 19,136 api-ms-win-crt-environment-l1-1-0.dll
05/01/2017 08:42 PM 20,672 api-ms-win-crt-filesystem-l1-1-0.dll
05/01/2017 08:42 PM 19,136 api-ms-win-crt-heap-l1-1-0.dll
05/01/2017 08:42 PM 19,136 api-ms-win-crt-locale-l1-1-0.dll
05/01/2017 08:42 PM 27,840 api-ms-win-crt-math-l1-1-0.dll
05/01/2017 08:42 PM 26,296 api-ms-win-crt-multibyte-l1-1-0.dll
05/01/2017 08:42 PM 70,848 api-ms-win-crt-private-l1-1-0.dll
05/01/2017 08:42 PM 19,648 api-ms-win-crt-process-l1-1-0.dll
05/01/2017 08:42 PM 23,232 api-ms-win-crt-runtime-l1-1-0.dll
05/01/2017 08:42 PM 24,768 api-ms-win-crt-stdio-l1-1-0.dll
05/01/2017 08:42 PM 24,768 api-ms-win-crt-string-l1-1-0.dll
05/01/2017 08:42 PM 21,184 api-ms-win-crt-time-l1-1-0.dll
05/01/2017 08:42 PM 19,136 api-ms-win-crt-utility-l1-1-0.dll
40 File(s) 857,056 bytes
Directory of c:\Program Files\PowerShell\6.0.0.16
06/13/2016 10:46 PM 18,672 API-MS-Win-Base-Util-L1-1-0.dll
06/13/2016 10:46 PM 23,272 api-ms-win-core-com-l1-1-0.dll
06/13/2016 10:46 PM 18,696 api-ms-win-core-com-private-l1-1-0.dll
06/13/2016 10:46 PM 19,696 api-ms-win-core-comm-l1-1-0.dll
06/13/2016 10:46 PM 19,192 api-ms-win-core-console-l1-1-0.dll
06/13/2016 10:46 PM 21,248 api-ms-win-core-console-l2-1-0.dll
06/13/2016 10:46 PM 18,688 api-ms-win-core-datetime-l1-1-0.dll
06/13/2016 10:46 PM 18,688 api-ms-win-core-datetime-l1-1-1.dll
06/13/2016 10:46 PM 18,672 api-ms-win-core-debug-l1-1-0.dll
06/13/2016 10:46 PM 19,192 api-ms-win-core-debug-l1-1-1.dll
06/13/2016 10:46 PM 18,688 api-ms-win-core-delayload-l1-1-0.dll
06/13/2016 10:46 PM 19,216 api-ms-win-core-errorhandling-l1-1-0.dll
06/13/2016 10:46 PM 19,224 api-ms-win-core-errorhandling-l1-1-1.dll
06/13/2016 10:46 PM 18,680 api-ms-win-core-fibers-l1-1-0.dll
06/13/2016 10:46 PM 18,680 api-ms-win-core-fibers-l1-1-1.dll
06/13/2016 10:46 PM 22,768 api-ms-win-core-file-l1-1-0.dll
06/13/2016 10:46 PM 18,672 api-ms-win-core-file-l1-2-0.dll
06/13/2016 10:46 PM 18,672 api-ms-win-core-file-l1-2-1.dll
06/13/2016 10:46 PM 19,184 api-ms-win-core-file-l2-1-0.dll
06/13/2016 10:46 PM 18,672 api-ms-win-core-file-l2-1-1.dll
06/13/2016 10:46 PM 18,680 api-ms-win-core-handle-l1-1-0.dll
06/13/2016 10:46 PM 19,184 api-ms-win-core-heap-l1-1-0.dll
06/13/2016 10:46 PM 19,216 api-ms-win-core-heap-obsolete-l1-1-0.dll
06/13/2016 10:46 PM 19,216 api-ms-win-core-interlocked-l1-1-0.dll
06/13/2016 10:46 PM 19,176 api-ms-win-core-io-l1-1-0.dll
06/13/2016 10:46 PM 18,664 api-ms-win-core-io-l1-1-1.dll
06/13/2016 10:46 PM 21,784 api-ms-win-core-kernel32-legacy-l1-1-0.dll
06/13/2016 10:46 PM 19,736 api-ms-win-core-kernel32-legacy-l1-1-1.dll
06/13/2016 10:46 PM 19,224 api-ms-win-core-kernel32-legacy-l1-1-2.dll
06/13/2016 10:46 PM 19,744 API-MS-Win-Core-Kernel32-Private-L1-1-0.dll
06/13/2016 10:46 PM 18,720 API-MS-Win-Core-Kernel32-Private-L1-1-1.dll
06/13/2016 10:46 PM 19,744 API-MS-Win-Core-Kernel32-Private-L1-1-2.dll
06/13/2016 10:46 PM 19,728 api-ms-win-core-libraryloader-l1-1-0.dll
06/13/2016 10:46 PM 19,224 api-ms-win-core-libraryloader-l1-1-1.dll
06/13/2016 10:46 PM 21,776 api-ms-win-core-localization-l1-2-0.dll
06/13/2016 10:46 PM 18,704 api-ms-win-core-localization-l1-2-1.dll
06/13/2016 10:46 PM 19,216 api-ms-win-core-localization-l2-1-0.dll
06/13/2016 10:46 PM 19,256 api-ms-win-core-localization-obsolete-l1-2-0.dll
06/13/2016 10:46 PM 19,192 api-ms-win-core-memory-l1-1-0.dll
06/13/2016 10:46 PM 19,704 api-ms-win-core-memory-l1-1-1.dll
06/13/2016 10:46 PM 19,192 api-ms-win-core-memory-l1-1-2.dll
06/13/2016 10:46 PM 18,680 api-ms-win-core-memory-l1-1-3.dll
06/13/2016 10:46 PM 19,200 api-ms-win-core-namedpipe-l1-1-0.dll
06/13/2016 10:46 PM 18,696 api-ms-win-core-namedpipe-l1-2-1.dll
06/13/2016 10:46 PM 18,712 api-ms-win-core-normalization-l1-1-0.dll
06/13/2016 10:46 PM 19,736 API-MS-Win-Core-PrivateProfile-L1-1-0.dll
06/13/2016 10:46 PM 18,712 api-ms-win-core-privateprofile-l1-1-1.dll
06/13/2016 10:46 PM 19,752 api-ms-win-core-processenvironment-l1-1-0.dll
06/13/2016 10:46 PM 18,728 api-ms-win-core-processenvironment-l1-2-0.dll
06/13/2016 10:46 PM 19,232 api-ms-win-core-processsecurity-l1-1-0.dll
06/13/2016 10:46 PM 21,272 api-ms-win-core-processthreads-l1-1-0.dll
06/13/2016 10:46 PM 19,736 api-ms-win-core-processthreads-l1-1-1.dll
06/13/2016 10:46 PM 19,224 api-ms-win-core-processthreads-l1-1-2.dll
06/13/2016 10:46 PM 19,272 API-MS-Win-Core-ProcessTopology-Obsolete-L1-1-0.dll
06/13/2016 10:46 PM 18,680 api-ms-win-core-profile-l1-1-0.dll
06/13/2016 10:46 PM 19,208 api-ms-win-core-psapi-ansi-l1-1-0.dll
06/13/2016 10:46 PM 19,696 api-ms-win-core-psapi-l1-1-0.dll
06/13/2016 10:46 PM 19,224 api-ms-win-core-psapi-obsolete-l1-1-0.dll
06/13/2016 10:46 PM 19,200 api-ms-win-core-realtime-l1-1-0.dll
06/13/2016 10:46 PM 20,736 api-ms-win-core-registry-l1-1-0.dll
06/13/2016 10:46 PM 20,224 api-ms-win-core-registry-l2-1-0.dll
06/13/2016 10:46 PM 19,208 api-ms-win-core-rtlsupport-l1-1-0.dll
06/13/2016 10:46 PM 23,320 api-ms-win-core-shlwapi-legacy-l1-1-0.dll
06/13/2016 10:46 PM 21,280 api-ms-win-core-shlwapi-obsolete-l1-1-0.dll
06/13/2016 10:46 PM 18,688 api-ms-win-core-shutdown-l1-1-0.dll
06/13/2016 10:46 PM 18,688 api-ms-win-core-shutdown-l1-1-1.dll
06/13/2016 10:46 PM 19,192 api-ms-win-core-string-l1-1-0.dll
06/13/2016 10:46 PM 19,192 API-MS-Win-Core-String-L2-1-0.dll
06/13/2016 10:46 PM 19,232 api-ms-win-core-string-obsolete-l1-1-0.dll
06/13/2016 10:46 PM 19,232 api-ms-win-core-string-obsolete-l1-1-1.dll
06/13/2016 10:46 PM 19,208 API-MS-Win-Core-StringAnsi-L1-1-0.dll
06/13/2016 10:46 PM 18,704 api-ms-win-core-stringloader-l1-1-0.dll
06/13/2016 10:46 PM 18,704 api-ms-win-core-stringloader-l1-1-1.dll
06/13/2016 10:46 PM 20,720 api-ms-win-core-synch-l1-1-0.dll
06/13/2016 10:46 PM 19,696 api-ms-win-core-synch-l1-2-0.dll
06/13/2016 10:46 PM 19,712 api-ms-win-core-sysinfo-l1-1-0.dll
06/13/2016 10:46 PM 19,200 api-ms-win-core-sysinfo-l1-2-0.dll
06/13/2016 10:46 PM 19,192 api-ms-win-core-sysinfo-l1-2-1.dll
06/13/2016 10:46 PM 18,680 api-ms-win-core-sysinfo-l1-2-2.dll
06/13/2016 10:46 PM 18,688 api-ms-win-core-sysinfo-l1-2-3.dll
06/13/2016 10:46 PM 21,256 api-ms-win-core-threadpool-l1-2-0.dll
06/13/2016 10:46 PM 19,240 api-ms-win-core-threadpool-legacy-l1-1-0.dll
06/13/2016 10:46 PM 18,728 api-ms-win-core-threadpool-private-l1-1-0.dll
06/13/2016 10:46 PM 19,200 api-ms-win-core-timezone-l1-1-0.dll
06/13/2016 10:46 PM 20,200 api-ms-win-core-url-l1-1-0.dll
06/13/2016 10:46 PM 18,672 api-ms-win-core-util-l1-1-0.dll
06/13/2016 10:46 PM 18,688 api-ms-win-core-version-l1-1-0.dll
06/13/2016 10:46 PM 19,728 api-ms-win-core-winrt-error-l1-1-0.dll
06/13/2016 10:46 PM 19,216 api-ms-win-core-winrt-error-l1-1-1.dll
06/13/2016 10:46 PM 19,704 api-ms-win-core-winrt-l1-1-0.dll
06/13/2016 10:46 PM 19,240 api-ms-win-core-winrt-registration-l1-1-0.dll
06/13/2016 10:46 PM 19,224 api-ms-win-core-winrt-robuffer-l1-1-0.dll
06/13/2016 10:46 PM 19,272 api-ms-win-core-winrt-roparameterizediid-l1-1-0.dll
06/13/2016 10:46 PM 20,240 api-ms-win-core-winrt-string-l1-1-0.dll
06/13/2016 10:46 PM 18,680 api-ms-win-core-wow64-l1-1-0.dll
06/13/2016 10:46 PM 19,192 api-ms-win-core-xstate-l1-1-0.dll
06/13/2016 10:46 PM 19,192 api-ms-win-core-xstate-l2-1-0.dll
06/13/2016 10:46 PM 21,256 API-MS-Win-devices-config-L1-1-0.dll
06/13/2016 10:46 PM 21,256 API-MS-Win-devices-config-L1-1-1.dll
06/13/2016 10:46 PM 19,248 API-MS-Win-Eventing-ClassicProvider-L1-1-0.dll
06/13/2016 10:46 PM 18,704 API-MS-Win-Eventing-Consumer-L1-1-0.dll
06/13/2016 10:46 PM 19,224 API-MS-Win-Eventing-Controller-L1-1-0.dll
06/13/2016 10:46 PM 19,208 API-MS-Win-Eventing-Legacy-L1-1-0.dll
06/13/2016 10:46 PM 19,216 API-MS-Win-Eventing-Provider-L1-1-0.dll
06/13/2016 10:46 PM 19,208 API-MS-Win-EventLog-Legacy-L1-1-0.dll
06/13/2016 10:46 PM 19,216 api-ms-win-ro-typeresolution-l1-1-0.dll
06/13/2016 10:46 PM 24,832 api-ms-win-security-base-l1-1-0.dll
06/13/2016 10:46 PM 18,688 api-ms-win-security-cpwl-l1-1-0.dll
06/13/2016 10:46 PM 20,760 api-ms-win-security-cryptoapi-l1-1-0.dll
06/13/2016 10:46 PM 19,224 api-ms-win-security-lsalookup-l2-1-0.dll
06/13/2016 10:46 PM 18,712 api-ms-win-security-lsalookup-l2-1-1.dll
06/13/2016 10:46 PM 19,728 API-MS-Win-Security-LsaPolicy-L1-1-0.dll
06/13/2016 10:46 PM 19,216 api-ms-win-security-provider-l1-1-0.dll
06/13/2016 10:46 PM 19,200 api-ms-win-security-sddl-l1-1-0.dll
06/13/2016 10:46 PM 18,688 api-ms-win-service-core-l1-1-0.dll
06/13/2016 10:46 PM 18,688 api-ms-win-service-core-l1-1-1.dll
06/13/2016 10:46 PM 19,224 api-ms-win-service-management-l1-1-0.dll
06/13/2016 10:46 PM 19,216 api-ms-win-service-management-l2-1-0.dll
06/13/2016 10:46 PM 19,720 api-ms-win-service-private-l1-1-0.dll
06/13/2016 10:46 PM 19,720 api-ms-win-service-private-l1-1-1.dll
06/13/2016 10:46 PM 20,232 api-ms-win-service-winsvc-l1-1-0.dll
121 File(s) 2,358,064 bytes
Total Files Listed:
161 File(s) 3,215,120 bytes
0 Dir(s) 118,003,507,200 bytes free
Activity
[-]PowerShell Core is Broken on Windows 7 After the Upgrade to .Net Core[/-][+]PowerShell Core is Broken on Windows 7 After the Upgrade to .Net Core 2.0[/+]lukegriffith commentedon May 13, 2017
I have the same issue on MacOS, using System.Management.Automation.Language.Parser.ParseFile(...)
netcoreapp2.0 + system.management.automation Version="6.0.0-beta.1"
MaximoTrinidad commentedon May 14, 2017
FYI
Documentation on v6.0.0-beta.1 release of PowerShellCore release notes states:
"Note: Windows 7 support is currently broken, and we plan to release a working package in the future."
I won't try to use .NET Core 2.0 Preview on any previous version for PowerShell Alpha.
Windows 10, WSL BASH, and Ubuntu seems running OK!
iSazonov commentedon May 14, 2017
@lukemgriffith Please open new Issue with repo steps and full errors report.
2 remaining items
MaximoTrinidad commentedon May 17, 2017
I spoke too soon!!
PowerShell 6.0.0-beta gets hung up in Windows 10 Bash Console but not when you use the Ubuntu Desktop under Xserver. (See attached Images)
Bash Console:

Bash in Ubuntu Desktop in Windows 10 Insider Build 16193:

MaximoTrinidad commentedon May 17, 2017
I already logged it on WSL: PowerShell 6.0.0-beta hung up in Windows 10 Bash Console. #2124
SteveL-MSFT commentedon May 17, 2017
Maximo Trinidad (@MaximoTrinidad) you have to use the full URL or include the org/repo since the issue is in a different repo: microsoft/WSL#2124
MaximoTrinidad commentedon May 17, 2017
Thanks Steve Lee (@SteveL-MSFT) ! I update the link.
:)
MaximoTrinidad commentedon May 18, 2017
FYI
I completed testing PowerShell 6.0.0-beta on my Window 10 Bash Console. I uninstall and did a clean Bash installation without .NET Core 2.0 Preview 1 and PowerShell is getting hung.
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
exit
In my case, is was nothing to do with .NET Core installation.
adityapatwardhan commentedon Aug 4, 2017
Fixed with #4438
iSazonov commentedon Aug 6, 2017
Fixed with #4463.
PowerShell 6 on Win7 failed to build
ferenczy commentedon Aug 29, 2019
Sorry, but it doesn't seem to be fixed. Two examples where a regular command causes the DLL load issue follow.
Get-Itemwith-StreamoptionStart-Processwith-WaitoptionIn both cases, it's caused by the mentioned option. Without those options, the commands are successful.
Windows 7 Ultimate 64bit
Should I create a new issue or is it the same cause?
iSazonov commentedon Aug 29, 2019
David Ferenczy Rogožan (@ferenczy) Please open new issue.