Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

swaroop-sridhar
Copy link
Contributor

@swaroop-sridhar swaroop-sridhar commented Apr 30, 2020

Customer Scenario

Self-contained Apps published as a single-file fail at run-time.

Problem

Single-file bundles are now processed in the framework rather than the apphost (dotnet/runtime#34274).
This means that hostpolicy and hostfxr DLLs are excluded from being bundled themselves.
In the case of self-contained single-file apps, these files need to be separate files until static-apphost is available.
This needs to be ensured by the SDK; otherwise app execution will fail.

Solution

This change fixes the problem by adapting the SDK to:

  • Pass the correct target-OS settings (otherwise cross-targetting builds will not work correctly)
  • Copy files excluded by the Bundler to the publish directory.

The stage-0 netcoreapp is updated to preview4, because preview2 apphost is not compatible with preview4 bundler.

Risk

Low

Alternatives

The alternative to taking this change in preview 4 is to revert the bundle processing change from runtime preview 4 branch.

This fix can then be performed in master branch.

…sing extraction

Customer Scenario
Self-contained Apps published as a single-file fail at run-time.

Problem

Single-file bundles are now processed in the framework rather than the apphost (dotnet/runtime#34274).
This means that hostpolicy and hostfxr DLLs are excluded from being bundled themselves.
In the case of self-contained single-file apps, these files need to be separate files until static-apphost is available.
This needs to be ensured by the SDK; otherwise app execution will fail.

Solution

This change fixes the problem by adapting the SDK to:
* Pass the correct target-OS settings (otherwise cross-targetting builds will not work correctly)
* Copy files excluded by the Bundler to the publish directory.

The stage-0 netcoreapp is updated to preview4, because preview2 apphost is not compatible with preview4 bundler.

Risk
Low
Copy link
Member

@dsplaisted dsplaisted left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we have no coverage for running single file apps before this? Once this is inserted into dotnet/installer, I think we should add these new tests to the integration tests that are run there.

Also, if hostpolicy and hostfxr are no longer part of the bundle, does this mean that "single file apps" are now a minimum of 3 files?


protected override void ExecuteCore()
{
OSPlatform targetOS = RuntimeIdentifier.StartsWith("win") ? OSPlatform.Windows :
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be walking the RuntimeIdentifier graph instead of checking what the RuntimeIdentifier starts with?

@swaroop-sridhar
Copy link
Contributor Author

Also, if hostpolicy and hostfxr are no longer part of the bundle, does this mean that "single file apps" are now a minimum of 3 files?

Yes HostPolicy and HostFxr need to be separate files temporarily, until the work to link these components into the apphost (dotnet/runtime#35368) and consume them from the SDK is completed.

I think we should add these new tests to the integration tests that are run there.

Tests to run single-file apps are in the runtime repo, while the ones here were testing publishing, checking the files generated, etc. But this is not sufficient coverage. I'll follow up on the integration changes.

@swaroop-sridhar
Copy link
Contributor Author

@dsplaisted I'll close this PR, because it was preferred to revert the original change that processes bundles from framework. I'll open a new PR to make this change in master branch,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants