From 37ef70342a5b3754ee1cece165fec4e6da4f39b1 Mon Sep 17 00:00:00 2001 From: DevTKSS Date: Sat, 26 Jul 2025 20:33:04 +0200 Subject: [PATCH 1/6] docs(AppData): Introduce the User how to use LinkBase Property to keep Serialized AppData Files in Sync across multiple Projects in the Solution When working with Serialized AppData Files in Uno Projects, it's common to face challenges in keeping this shared App Data synchronized across multiple projects within the same solution. A practical approach to address this issue is by utilizing the LinkBase Property, similar to the method employed in Chef's App. For Users which are not familiar with this Property, this commit provides: - A detailed explanation of the LinkBase Property and its purpose. - A code snippet demonstrating how to set up the LinkBase Property in a project file. - A markdown diagram illustrating how this linked folder will show up in the Solution Explorer. - Link to the Chefs App csproj, so the User will then also be able, to learn from the Chefs App Sample implementation. This review was Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- doc/external/StorageFile.md | 41 +++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/doc/external/StorageFile.md b/doc/external/StorageFile.md index ea95c5aae..a0ee11dd9 100644 --- a/doc/external/StorageFile.md +++ b/doc/external/StorageFile.md @@ -12,14 +12,51 @@ You need to load app data files on all platforms. Traditional file access method Use the `Windows.Storage.StorageFile` API to read files from your app package. This works the same way on all Uno Platform targets, including WASM. -- Move your data files to be included as `Content` in your project, and use `StorageFile.GetFileFromApplicationUriAsync` to load them by path. +- Move your data files to be included as `Content` in your project's output directory, and use `StorageFile.GetFileFromApplicationUriAsync` to load them by path. To make sure, you will always have the latest changes included, set the appropriate sub Property: `CopyToOutputDirectory="PreserveNewest"`. ```xml - + ``` + - If you want to not just have these files in your app's output directory with latest changes, then also have your IDE showing them in your **Solution Explorer** and enable you editing them easily as if those would be directly nested in your specific project, you may want to also set another property on the xml element we just added: `LinkBase="AppData"` (or any other Name you want it to show to you as folder name). + + So this will make the full Content Element look like this: + + ```xml + + + + ``` + + And in your Solution Explorer, this will show up like with the below shown grey text (VS Code) or with a Link Arrow like you may know it from .ink files on your Desktop (Visual Studio 2022). + + ```markdown + root + |-AppData + | |-yourDataContainingFile.json + |-ClientApp/ + | |-ClientApp.csproj + | |-AppData/ *(Linked File)* + | |-yourDataContainingFile.json *(Linked File)* + |-ClientApp.Api/ + | |-ClientApp.Api.csproj + | |-AppData/ *(Linked File)* + | |-yourDataContainingFile.json *(Linked File)* + |-ClientApp.IntegrationTests/... + |-ClientApp.UITests/... + |-ClientApp.UnitTests/... + ``` + + > [!TIP] + > Another advantage of setting the LinkBase Property like shown above is, that you can do this on every project in your Solution you like to, without being required to: + > + > - duplicate the Folder or Files + > - if you edit a file in there, its state will always be synced + > [!TIP] + > If you may not want to have those files in your output directory of the Project, but showing up in your Solution Explorer, you can set the `CopyToOutputDirectory` property shown before, to **Never**. + - Loading a JSON File Using StorageFile ```csharp From cd5d51005d4887208183e30d2e8770ce6035cc9f Mon Sep 17 00:00:00 2001 From: DevTKSS Date: Thu, 27 Nov 2025 21:12:49 +0100 Subject: [PATCH 2/6] chore: applying PR rewording suggestion Co-authored-by: Steve Bilogan --- doc/external/StorageFile.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/external/StorageFile.md b/doc/external/StorageFile.md index a0ee11dd9..883dba81f 100644 --- a/doc/external/StorageFile.md +++ b/doc/external/StorageFile.md @@ -12,7 +12,7 @@ You need to load app data files on all platforms. Traditional file access method Use the `Windows.Storage.StorageFile` API to read files from your app package. This works the same way on all Uno Platform targets, including WASM. -- Move your data files to be included as `Content` in your project's output directory, and use `StorageFile.GetFileFromApplicationUriAsync` to load them by path. To make sure, you will always have the latest changes included, set the appropriate sub Property: `CopyToOutputDirectory="PreserveNewest"`. +- Move your data files to be included as `Content` in your project's output directory, and use `StorageFile.GetFileFromApplicationUriAsync` to load them by path. To ensure that you will always have the latest changes included, set the appropriate Property: `CopyToOutputDirectory="PreserveNewest"`. ```xml From d99b677feaea0f88eff1e918ffba6020e46fd8ae Mon Sep 17 00:00:00 2001 From: DevTKSS Date: Sun, 28 Dec 2025 15:38:23 +0100 Subject: [PATCH 3/6] chore: Update Uno.Sdk Version to latest stable --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 7f65a2cc1..63858d527 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "msbuild-sdks": { - "Uno.Sdk": "6.3.28" + "Uno.Sdk": "6.4.42" }, "sdk": { "allowPrerelease": false From 208572e83a46e1bf3fd999e73389772557659858 Mon Sep 17 00:00:00 2001 From: DevTKSS Date: Sun, 28 Dec 2025 17:05:29 +0100 Subject: [PATCH 4/6] docs(StorageFile): reduce to brief information and add the LinkBase MS Docs link as requested --- .../appdata-linkbase-solution-explorer.png | Bin 0 -> 8411 bytes doc/external/StorageFile.md | 54 ++++++------------ 2 files changed, 16 insertions(+), 38 deletions(-) create mode 100644 doc/assets/appdata-linkbase-solution-explorer.png diff --git a/doc/assets/appdata-linkbase-solution-explorer.png b/doc/assets/appdata-linkbase-solution-explorer.png new file mode 100644 index 0000000000000000000000000000000000000000..1a8bde00002319c2212a04330397a7f42763d802 GIT binary patch literal 8411 zcmb7qXH=6-*KR;iibxj)4ZRBpQlz(p-U6X1f+(R1ND~vfg%YHN-XXLQno-+pT>pN$i^`0L|X6~8U_mn-?b?vwIIeI5Qz{_ zUZS`Rd>6~J{RVzWyo@!~K;`|nR)7kbgQ~tN2=pO_`qY*js8c@Ivh)IhuC@L7kaW1? z?0|<1-cSo~6L))WUt3QENYfL6aPx9>_qH~r0ETcFYeQ7wFReE+*W#_(kzxGo42Q9v zR<)FBkvxOsl-v*mjEADtQRI?@V_$()t>|?OJqP8Z>)Ok;Jy-%_+=J^?kC33yTO;kb z*8T3ckefZ_D#bcC5}$KkX)QQ)Cp)|(x3{mCjXc>0S%1;YRO@QowPB?AbHl zfz&#ekwSeF5Qt7fs-6S{QoDpD1(DH0$Uzj~a4Ha;0v$7m<0Xd>NM&0E4hsGef&+m* zo7CgnQl!iS7E*&u?@6>sDGGOew#@m;#iy>U?>OXAbM^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Rr{wfyYTPI* z|7O8OHu);&cT@LVlB8r=|11lj$XGtWvDW@;QvCm8)cgqiat!8S$T>_R(C%tO?8Oyn Y%PJ8^N8{(fe-A*~Py ``` - - If you want to not just have these files in your app's output directory with latest changes, then also have your IDE showing them in your **Solution Explorer** and enable you editing them easily as if those would be directly nested in your specific project, you may want to also set another property on the xml element we just added: `LinkBase="AppData"` (or any other Name you want it to show to you as folder name). - - So this will make the full Content Element look like this: - - ```xml - - - - ``` - - And in your Solution Explorer, this will show up like with the below shown grey text (VS Code) or with a Link Arrow like you may know it from .ink files on your Desktop (Visual Studio 2022). - - ```markdown - root - |-AppData - | |-yourDataContainingFile.json - |-ClientApp/ - | |-ClientApp.csproj - | |-AppData/ *(Linked File)* - | |-yourDataContainingFile.json *(Linked File)* - |-ClientApp.Api/ - | |-ClientApp.Api.csproj - | |-AppData/ *(Linked File)* - | |-yourDataContainingFile.json *(Linked File)* - |-ClientApp.IntegrationTests/... - |-ClientApp.UITests/... - |-ClientApp.UnitTests/... - ``` - - > [!TIP] - > Another advantage of setting the LinkBase Property like shown above is, that you can do this on every project in your Solution you like to, without being required to: - > - > - duplicate the Folder or Files - > - if you edit a file in there, its state will always be synced - > [!TIP] - > If you may not want to have those files in your output directory of the Project, but showing up in your Solution Explorer, you can set the `CopyToOutputDirectory` property shown before, to **Never**. - -- Loading a JSON File Using StorageFile +- To also display these files in your Solution Explorer, add `LinkBase="AppData"`: + + ```xml + + + + ``` + + ![VS Code Solution Explorer showing linked AppData files with 'external file links' note](../assets/appdata-linkbase-solution-explorer.png) + + > [!TIP] + > Using `LinkBase` allows multiple projects in your solution to reference the same files without duplication while keeping them synchronized across all projects. + > + > See [MSBuild LinkBase documentation](https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#linkbase) for details. + +- Loading a JSON File Using `StorageFile` ```csharp public abstract class BaseMockEndpoint(ISerializer serializer, ILogger _logger) From de8a4780307740dcfa30c5e1e4536b6c2f9399a8 Mon Sep 17 00:00:00 2001 From: DevTKSS Date: Sun, 28 Dec 2025 17:06:53 +0100 Subject: [PATCH 5/6] chore: add Information about the underlying used Serialization Uno Feature for completeness and add Link to appropriate related docs --- doc/external/StorageFile.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/external/StorageFile.md b/doc/external/StorageFile.md index d637005a9..af84fb8cc 100644 --- a/doc/external/StorageFile.md +++ b/doc/external/StorageFile.md @@ -4,6 +4,8 @@ uid: Uno.Recipes.StorageFile # Loading App Data +> **UnoFeatures:** `Serialization` (add to `` in your `.csproj`). + ## Problem You need to load app data files on all platforms. Traditional file access methods (`System.IO.File.Read*`, `EmbeddedResource`) do not work for Content files on WASM. @@ -57,6 +59,9 @@ Use the `Windows.Storage.StorageFile` API to read files from your app package. T } ``` + > [!NOTE] + > This sample utilizes `ISerializer` from Uno Extensions Serialization to deserialize the JSON content into a strongly-typed object. + > See the [Serialization documentation](xref:Uno.Recipes.Serialization) for more details and the [Walkthrough: Serialize JSON with Source Generators](xref:Uno.Extensions.Serialization.HowTo) for guidance on setting it up. - Using `LoadData` in `MockRecipeEndpoints` ```csharp From 6c80f5f3c28852c48923a2beddf15f048c6fe8b2 Mon Sep 17 00:00:00 2001 From: DevTKSS Date: Sun, 28 Dec 2025 17:07:42 +0100 Subject: [PATCH 6/6] chore: Add Information about the alternative for StorageFile usage by using Storage Extensions from Uno --- doc/external/StorageFile.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/external/StorageFile.md b/doc/external/StorageFile.md index af84fb8cc..1d84b610a 100644 --- a/doc/external/StorageFile.md +++ b/doc/external/StorageFile.md @@ -62,6 +62,9 @@ Use the `Windows.Storage.StorageFile` API to read files from your app package. T > [!NOTE] > This sample utilizes `ISerializer` from Uno Extensions Serialization to deserialize the JSON content into a strongly-typed object. > See the [Serialization documentation](xref:Uno.Recipes.Serialization) for more details and the [Walkthrough: Serialize JSON with Source Generators](xref:Uno.Extensions.Serialization.HowTo) for guidance on setting it up. + > [!TIP] + > Alternatively to `StorageFile`, you can use [`IStorage` from Uno Extensions Storage](xref:Uno.Extensions.Storage.Overview), which not only allows you to replace it with only one simple call to `IStorage.ReadPackageFileAsync(string path)` to get the same result with build-in serialization support, but also to provide your own `ISerializer` implementation if needed. + - Using `LoadData` in `MockRecipeEndpoints` ```csharp