Skip to content

Support for assets provided by library #2502

@Daoting

Description

@Daoting

Current behavior

  1. I create project with template "Cross-Platform Library".
  2. Add the image file to the Assets directory of this project.
  3. Set the build action to Content.
  4. xaml
    <Image Source="ms-appx:///Bs.Kehu/Assets/header.png" />

The image is displayed in uwp and android. But in iOS:

2020-01-20 11:05:49.261049+0800 UnoApp[12385:168687] \^[[41m\^[[30mfail\^[[39m\^[[22m\^[[49m: Windows.UI.Xaml.Media.ImageSource[0]
      Unable to locate bundle resource [ms-appx:///Bs.Kehu/Assets/header.png]

Maybe it's not a bug. But I failed to get any help about this. I propose to add some help about this.
Thanks!

Expected behavior

How to reproduce it (as minimally and precisely as possible)

Environment

Nuget Package:

Package Version(s):

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Windows
  • Build tasks
  • Solution Templates

Visual Studio:

  • 2017 (version: )
  • 2019 (version: )
  • for Mac (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

Metadata

Metadata

Assignees

Labels

difficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUIkind/enhancementNew feature or requestproject/resources 🈷️Categorizes an issue or PR as relevant to resources and localization (Resources, Assets,...)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions