From 648e978260f8cd809f51119ed8577390c54f30fd Mon Sep 17 00:00:00 2001 From: Roxk Date: Mon, 22 Apr 2024 23:41:13 +0800 Subject: [PATCH] doc: Nudge users into using Sample App mode --- README.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 71cafd4..c06ddcf 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,8 @@ The VS2022 extension would automatically find the WAP project that packages your WinRT Component preview support comes in two mode. One is "Direct" mode, another is "Sample App" mode. Direct mode means you can preview directly in-project. Sample App mode means you preview via a separate "Sample App" project. +It's suggested you use Sample App mode for reliability, however Direct mode is also supported for a quicker setup. + ## Limitation - Require building the project once before use - Packaged apps require being deployed before use @@ -121,39 +123,39 @@ Make sure to replace `$YourTargetName` with your build output name. E.g. if your 6. Viola! You have finished the setup for app project -### WinRT Component Project (Direct Mode) +### WinRT Component Project (Sample App Mode) 1. Install the [VS extension](https://marketplace.visualstudio.com/items?itemName=Roxk.winui3xamlpreview). Require VS2022 17.9+ -2. On your _WinUI 3 WinRT Component project_ that uses this feature, install the nuget +2. On your WinUI 3 WinRT Component's _Sample App project_ that uses this feature, install the nuget ``` nuget install WinUI3XamlPreview ``` -3. If you are using C++, add `$SampleAppProjectName` property. Make sure you replace `$SampleAppProjectName` with the name of the sample app project. E.g. if your WinRT Component's project name is `Lib`, your sample app (test app)'s project name is `LibTest`, the correct property value is `LibTest`. If you do not want to edit project file directly, you can (1) install the nuget on your _WinUI 3 WinRT Component project_, (2) edit the property by right clicking the component project in Visual Studio -> Properties -> WinUI3XamlPreview tab -> edit Launch Project. Make sure you disable the preview to save compile time. See [Configuration](#Configuration) section for more details -5. Viola! You have finished the setup for WinRT Component proejct Direct mode. +5. Viola! You have finished the setup for WinRT Component proejct Sample App mode. -### WinRT Component Project (Sample App Mode) +### WinRT Component Project (Direct Mode) 1. Install the [VS extension](https://marketplace.visualstudio.com/items?itemName=Roxk.winui3xamlpreview). Require VS2022 17.9+ -2. On your WinUI 3 WinRT Component's _Sample App project_ that uses this feature, install the nuget +2. On your _WinUI 3 WinRT Component project_ that uses this feature, install the nuget ``` nuget install WinUI3XamlPreview ``` -3. If you are using C++, add `$SampleAppProjectName` property. Make sure you replace `$SampleAppProjectName` with the name of the sample app project. E.g. if your WinRT Component's project name is `Lib`, your sample app (test app)'s project name is `LibTest`, the correct property value is `LibTest`. If you do not want to edit project file directly, you can (1) install the nuget on your _WinUI 3 WinRT Component project_, (2) edit the property by right clicking the component project in Visual Studio -> Properties -> WinUI3XamlPreview tab -> edit Launch Project. Make sure you disable the preview to save compile time. See [Configuration](#Configuration) section for more details +4. If your project has no dependency/only project-reference dependencies, you have finished the setup. If you have any dynamic nuget/external dependencies, make sure they are copied to the output folder. -5. Viola! You have finished the setup for WinRT Component proejct Sample App mode. +For example, suppose your project is `LibA` inside `Lib` folder with `Lib.sln`. With default output directory settings, you should copy any dll dependencies to `Lib\x64\Debug\LibA` if you want to preview `LibA` in `x64|Debug` configuration. + +5. Viola! You have finished the setup for WinRT Component proejct Direct mode. ## Usage