You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two main tasks that need to be done for self-contained single-file publish scenario:
Use singlefilehost
@VSadov's PR adds singlefilehost to the microsoft.netcore.app.host.* packages.
ResolveAppHosts will resolve singlefilehost to the same package as apphost, ijwhost, and comhost.
When publishing for self-contained single-file apps, the CreateAppHost task will be invoked with the singlefilehost path as its AppHostSourcePath. This will generate an app using singlefilehost.
This may not work very well for a sequence such below. However, I think fixing this case is not crucial, because the --no-build already has similar concerns for self-contained vs framework-dependent publish.
Certain files in microsoft.netcore.app.runtime.* package are no longer necessary to be published for single-file apps.
For example, hostfxr and hostpolicy are not necessary since they are statically linked with singlefilehost. Later coreclr, clrjit will also be linked with the singlefilehost, and they are also not necessary. Certain other files such as createdump are excluded from the publish as a matter of policy decision.
This exclusion is different from ExcludeFromSingleFile
In this case, the files, the excluded files are not published at all (neither in the bundle nor in the publish directory beside the single-file bundle).
Files marked ExcludeFromSingleFile are copied to publish directory alongside the single-file app.
The plan to realize this exclusion of runtime components is:
The RuntimeList.xml in microsoft.netcore.app.runtime.* package will contain special meta-data identifying that the file is not necessary for single-file scenario <File FileVersion="0.0.0.0" Path="runtimes/linux-x64/native/createdump" Type="Native" DropFromSingleFile="true"/>
There are two main tasks that need to be done for self-contained single-file publish scenario:
Use
singlefilehostsinglefilehostto themicrosoft.netcore.app.host.*packages.singlefilehostto the same package asapphost,ijwhost, andcomhost.AppHostSourcePath. This will generate an app usingsinglefilehost.--no-buildalready has similar concerns for self-contained vs framework-dependent publish.Trim the native components of the runtime:
microsoft.netcore.app.runtime.*package are no longer necessary to be published for single-file apps.hostfxrandhostpolicyare not necessary since they are statically linked withsinglefilehost. Latercoreclr,clrjitwill also be linked with thesinglefilehost, and they are also not necessary. Certain other files such ascreatedumpare excluded from the publish as a matter of policy decision.ExcludeFromSingleFileExcludeFromSingleFileare copied to publish directory alongside the single-file app.RuntimeList.xmlinmicrosoft.netcore.app.runtime.*package will contain special meta-data identifying that the file is not necessary for single-file scenario<File FileVersion="0.0.0.0" Path="runtimes/linux-x64/native/createdump" Type="Native" DropFromSingleFile="true"/>ResolveRuntimePackAssetstask will transfer this annotation as (DropFromSingleFile) meta-data on the asset.