Skip to content

[WinUI 3] Cannot locate resource from 'ms-appx:///FooLibrary/Themes/Foo.xaml'. [Line: X Position: Y] #7788

@boexler

Description

@boexler

Describe the bug

I have a source library HtSuite.WinUI.UI which is deployed as a nuget package. Inside of this project are some ResourceDictionary.
Now I made a new project, added my nuget package and wanted to link the ResourceDictionary in the App.xaml.

Steps to reproduce the bug

  1. Create a Library project, add a ResourceDictionary and deploy it as a nuget package
  2. Create a new WinUI project, add the nuget package and try to add the ResourceDictionary in the App.xaml

Expected behavior

No response

Screenshots

NuGet Package Project: HtSuite.WinUI.UI *.csproj

  <PropertyGroup>
    <TargetFramework>net6.0-windows10.0.18362.0</TargetFramework>
    <TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
    <RootNamespace>Haprotec.WinUI.UI</RootNamespace>
    <RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
    <UseWinUI>true</UseWinUI>
    <WindowsPackageType>None</WindowsPackageType>
    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
    <!--https://github.com/dotnet/maui/issues/5886-->
    <WinUISDKReferences>false</WinUISDKReferences>
    <EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
    <GenerateLibraryLayout>true</GenerateLibraryLayout>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  </PropertyGroup>

CorporateDesign.xaml

grafik

T2020.UI Application with error message

grafik

grafik

NuGet package version

No response

Windows app type

  • UWP
  • Win32

Device form factor

No response

Windows version

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions