From 9c9d553970ff8953b70cb455c793108dbf2be080 Mon Sep 17 00:00:00 2001 From: Swaroop Sridhar Date: Fri, 14 Feb 2020 01:25:35 -0800 Subject: [PATCH] Make clarification about Appcontext.BaseDirectory --- accepted/single-file/design.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/accepted/single-file/design.md b/accepted/single-file/design.md index 5b3137ed5..fcdf1e334 100644 --- a/accepted/single-file/design.md +++ b/accepted/single-file/design.md @@ -77,8 +77,8 @@ The following settings can be used to package additional files into the single-f | Property | Behavior when set to `true` | | ------------------------------------ | ------------------------------------------------------------ | | `IncludeNativeLibrariesInSingleFile` | Bundle published native binaries into the single-file app. | -| `IncludeAllContentInSingleFile` | Bundle all published files (except symbol files) into single-file app. This option is proposed to replicate the .net core 3 version of single-file apps. | | `IncludeSymbolsInSingleFile` | Bundle symbol files (IL `.pdb` file, and the native `.ni.pdb` / `app.guid.map` files generated by ready-to-run compiler) into the single file app. | +| `IncludeAllContentInSingleFile` | Bundle all published files (except symbol files) into single-file app. This option is proposed to replicate the .net core 3 version of single-file apps. | Certain files can be explicitly excluded from being embedded in the single-file by setting following `ExcludeFromSingleFile` meta-data element. For example, to place some files in the publish directory but not bundle them in the single-file: @@ -227,11 +227,9 @@ Most of the app development can be agnostic to whether the app is published as s #### `AppContext.BaseDirectory` -`AppContext.BaseDirectory` will be the directory where the AppHost (the single-file bundle itself) resides. - -This is a change from [.net core 3 semantics](design_3_0.md#API-Impact) for single-file apps, where `AppContext.BaseDirectory` returned the directory where the bundle-contents were extracted. In .net 5, extraction is not performed by default. Therefore, the details about extraction directory are not exposed through the `AppContext.BaseDirectory` API. +`AppContext.BaseDirectory` will be the directory where the AppHost (the single-file bundle itself) resides. In contrast to [.net core 3 single-file apps](design_3_0.md), .net 5 single-file apps do not always self-extract on startup. Therefore, the details about extraction directory are not exposed through the `AppContext.BaseDirectory` API. -However, if files not handled by the runtime are bundled into the single-file (due to `IncludeAllContentInSingleFile` property which emulates .net core 3 bundling behavior) the app will need a (new) API to locate the extraction directory. +However, when single file apps are published with `IncludeAllContentInSingleFile` property set (which emulates .net core 3 bundling behavior), `AppContext.BaseDirectory` returns the extraction directory, following [.net core 3 semantics](design_3_0.md#API-Impact). ## Handling Content