Epsil0neR
Epsil0neR
CC#
Created by Epsil0neR on 11/9/2024 in #help
WinUI 3 controls project dll misses XAML resources
Guys, I need a help with WinUI 3: I have solution with APP project and controls library. App project has defined all ResourceDictionaries.xaml and consumed in App.xaml - all they work correctly. Controls project has also a multiple ResourceDictionaries.xaml for each control and all they are combined in Themes\Generic.xaml When I building controls project and analyzing .dll with dotPeek - I cant find any resources in dll, but see that bin/Debug folder contains folder Themes with Generic.xaml and Generic.xbf (what is that??) How can I build a my controls project with included correctly xaml resources? Here is controls.csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>MyApp.Controls</RootNamespace>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<Platforms>x86;x64;arm64</Platforms>
<UseWinUI>true</UseWinUI>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Page Remove="Resources\**\*.xaml" />
<None Update="Resources\**\*.xaml">
<Generator>MSBuild:Compile</Generator>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240428000" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.3233" />
</ItemGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>MyApp.Controls</RootNamespace>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<Platforms>x86;x64;arm64</Platforms>
<UseWinUI>true</UseWinUI>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Page Remove="Resources\**\*.xaml" />
<None Update="Resources\**\*.xaml">
<Generator>MSBuild:Compile</Generator>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240428000" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.3233" />
</ItemGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>
1 replies