Last active
July 4, 2026 09:06
-
-
Save luojunyuan/4efd1e363e324593379c40d8b695d916 to your computer and use it in GitHub Desktop.
the minimal request csproj properties for creating an unpackage desktop winui app
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
| <Project Sdk="Microsoft.NET.Sdk"> | |
| <PropertyGroup> | |
| <OutputType>WinExe</OutputType> | |
| <TargetFramework>net9.0-windows10.0.26100.0</TargetFramework> | |
| <UseWinUI>true</UseWinUI> | |
| <Nullable>enable</Nullable> | |
| <ImplicitUsings>true</ImplicitUsings> | |
| <ApplicationManifest>app.manifest</ApplicationManifest> | |
| </PropertyGroup> | |
| <PropertyGroup> | |
| <EnableMsixTooling>true</EnableMsixTooling> | |
| <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained> | |
| <Platforms Condition="'$(WindowsAppSDKSelfContained)' == 'true'">x64;ARM64</Platforms> | |
| </PropertyGroup> | |
| <ItemGroup> | |
| <PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" /> | |
| <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250205002" /> | |
| <PackageReference Condition="'$(PublishAot)' == 'true'" Include="Microsoft.Web.WebView2" Version="1.0.3065.39" /> | |
| </ItemGroup> | |
| </Project> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I hate wasdk
不能排除这个,会直接影响生成产物,生成带 i18n 文件夹一大坨,直接只引用 Microsoft.WindowsAppSDK.WinUI 也是同理。
Include="Microsoft.WindowsAppSDK.Runtime"
下面这样就没问题。。也就是说最新的 wasdk winui 依赖方式像下面一样
如果依赖引用了低版本的 Microsoft.WindowsAppSDK 直接依赖就会报错,还是需要排除
关键只需要 去掉 Microsoft.Windows.AI.MachineLearning 这个包就完美如初了