-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[release/6.0] Support Single-file executable in Windows 7 #63533
Conversation
Tagging subscribers to this area: @agocke, @vitek-karas, @VSadov Issue DetailsBackport #63196 to .NET 6.0
|
CC: @agocke |
I have tested the release/6.0 changes and they unblock 6.0 singlefile apps on Windows7, as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. We should take for consideration in 6.0.x. We will need to ensure to get a code review from the owning area and look at the CI failures.
@VSadov How confident are we that this will solve all problems for win7? |
@agocke It fixes the known problem - it no longer requires
The crt API sets are known to the OS loader and the actual implementation is loaded instead, assuming that UCRT is installed, which we should document as a requirement on Windows 7, but it is a reasonable assumption. Considering that a WPF app runs with this fix, a lot of other apps will run. |
@VSadov .NET 5 already requires UCRT in Windows 7. |
@leecow The SDK fix is mandatory for publishing: dotnet/sdk#23336 |
If we can't bring the SDK fix in in time, users can also use the |
The SDK fix is merely removing the warning and string resources. |
Backport #63196 to .NET 6.0
Customer Impact
As of .NET 6.0 single file apps are not supported on Windows7.
A 6.0 singlefile app does not include API set files (
api-ms-win-...
files). It was assumed that the apps cannot run without bundling/extracting these files due to various dependencies.Turns out the actual API set requirements of .NET runtime are very modest. We only use UCRT and WinRT API sets.
So the real reason why 6.0 singlefile app does not run on Windows7 is because
api-ms-win-core-winrt-l1-1-0.dll
is eagerly loaded, even though it would not be used.Making
api-ms-win-core-winrt-l1-1-0.dll
delayloaded insinglefilehost
enables apps to run. That would also match the behavior of standalonecoreclr.dll
whereapi-ms-win-core-winrt-l1-1-0.dll
is also delayloaded.Basically, with this change, instead of not supporting singlefile apps on Windows7, we can support, as long as SP1 and UCRT are installed, which is reasonable expectation and SP1 is already a requirement.
Testing
I have verified manually that with this fix singlefile apps run on Windows7 SP1
I've tried:
IncludeNativeLibrariesForSelfExtract
Risk
Risk is low.
Currently .net 6.0 singlefile apps do not run on Windows7 at all, so it can't get worse.
For other versions of Windows, singlefile app will just match closer the delayload behavior of standalone
coreclr.dll
.