fix: resolve WinUI 3 build conflicts and add WinUI chat example#1319
Open
avikeid2007 wants to merge 4 commits intoSciSharp:masterfrom
Open
fix: resolve WinUI 3 build conflicts and add WinUI chat example#1319avikeid2007 wants to merge 4 commits intoSciSharp:masterfrom
avikeid2007 wants to merge 4 commits intoSciSharp:masterfrom
Conversation
Fixed duplicate file errors (NETSDK1152/APPX1101) in Windows App SDK packaging. Included a new WinUI 3 desktop example with a streaming chat interface.
Also remove LLama.Examples.WinUI from LLamaSharp.sln in CI for non-Windows environments, alongside Llama.Mobile. This ensures platform-specific projects are excluded where not supported.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: resolve WinUI 3 build conflicts and add modern chat example
Summary
Closes #1318.
This PR resolves critical build and MSIX packaging failures (
NETSDK1152andAPPX1101) encountered when usingLLamaSharp.Backend.Cpuin Windows App SDK (WinUI 3) and MAUI projects. These errors were caused by strict file uniqueness checks on the hierarchical native library structure used for runtime AVX selection.Changes
1. Build & Packaging Support
Modified LLamaSharp.Runtime.targets to support WinUI environments:
UseWinUIto disable the strict .NET SDK duplicate publish file checks.DeduplicateAppxPackagePayloadtarget using the MSBuildRemoveDuplicatestask. This filters the native DLL identities before the packaging validation phase without flattening the required directory hierarchy.2. New WinUI 3 Example Project
Added a verified reference implementation in
LLama.Examples.WinUI:FileOpenPickerwith HWND interop for.ggufmodel selection.INotifyPropertyChangeddata binding to support real-time streaming responses word-by-word.User:from the output).Verification Results
Automated Tests
win-x64build of the WinUI example usingdotnet build.Manual Tests
Environment Details