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

Xaml Image not working in Wasm project after update to .net #18823

Open
premiaware opened this issue Nov 18, 2024 · 6 comments
Open

Xaml Image not working in Wasm project after update to .net #18823

premiaware opened this issue Nov 18, 2024 · 6 comments
Labels
area/external Categorizes an issue or PR as being external to the Uno

Comments

@premiaware
Copy link

Current behavior

I have update my single project solution to .net 9 and uno version 5.5.43, all working ok but the image control not show the image form url

 <Image
     Grid.Row="1"
     Grid.RowSpan="6"
     Grid.Column="0"
     Width="100"
     Height="80"
     HorizontalAlignment="Left"
     ImageFailed="Image_ImageFailed"
     Source="{x:Bind Thumbnail, Mode=OneWay}" />


        public BitmapImage Thumbnail
        {
            get {
                return  new BitmapImage(new System.Uri($"https://kinsta.com/it/wp-content/uploads/sites/2/2021/02/Cos_e_un_url.jpg")); 
                }
        }

this working in Desktop project but not in Wasm project

Expected behavior

No response

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

No response

Workaround

No response

Works on UWP/WinUI

Yes

Environment

Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia

NuGet package version(s)

No response

Affected platforms

WebAssembly

IDE

Visual Studio 2022

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@premiaware premiaware added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Nov 18, 2024
@jeromelaban
Copy link
Member

Thanks for the report! Can you provide a repro sample for your issue?

@jeromelaban jeromelaban added the triage/needs-information Indicates an issue needs more information in order to work on it. label Nov 18, 2024
@premiaware
Copy link
Author

UnoApp1.zip

I have attached sample.
Work with Desktop project
Not work with wasm project.

@github-actions github-actions bot removed the triage/needs-information Indicates an issue needs more information in order to work on it. label Nov 18, 2024
@jeromelaban
Copy link
Member

Thanks for the report.

This is happening because of this:

Failed to load resource: net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep

It looks like the .NET Wasm host is started with COEP enabled, causing the image to not show up. It's likely to be a .NET update, but in the meantime, you can run your app using dotnet run in the command line, the image will appear.

@premiaware
Copy link
Author

Ok, for the sample i can run "dotnet run" in my local machine,
but for production my Wasm App work in Azure Web Storage, how can fix it?

@jeromelaban
Copy link
Member

On the Azure Web Storage, the issue won't be there either. This is specific to the hosting when started from VS 2022.

@jeromelaban
Copy link
Member

Here's the related .NET issue: dotnet/runtime#109937

@jeromelaban jeromelaban added area/external Categorizes an issue or PR as being external to the Uno and removed kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/external Categorizes an issue or PR as being external to the Uno
Projects
None yet
Development

No branches or pull requests

2 participants