Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 of 2 tasks
djonasdev opened this issue Oct 5, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@djonasdev
Copy link

djonasdev commented Oct 5, 2022

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

@djonasdev djonasdev added the bug Something isn't working label Oct 5, 2022
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Oct 5, 2022
@djonasdev
Copy link
Author

After I commented out the following flags, it now works as usual.
Among other things, these were leftovers from the beginnings of WinUI and were "forgotten" in the course of development or seem to highlight such problems.

  <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>

@ghost ghost removed the needs-triage Issue needs to be triaged by the area owners label Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant