user24796397
user24796397

Reputation: 9

Image display issue in MAUI XAML

The issue is image is not display when i have created project MAUI. I am using .net 8 framework.

I have created by default simple project and also check downgrade the packages and also try to upgrade version but my issue is not resolved.

Upvotes: 0

Views: 536

Answers (2)

user24796397
user24796397

Reputation: 9

I have resolved this issue

I have updated Visual Studio Professional 2022 and i have used vs version 17.10.3 and i have also updated three libraries. CommunityToolkit.Maui(9.0.1), Microsoft.Maui.Controls(8.0.60) and Microsoft.Maui.Control.Compatibility(8.0.60).

##My previous visual studio version is 17.10.1 and CommunityToolkit.Maui(8.0.1), Microsoft.Maui.Controls(8.0.40) and Microsoft.Maui.Control.Compatibility(8.0.40).##

After updated my libraries and vs version issue is resolved automatically.

Upvotes: 0

Shuowen He-MSFT
Shuowen He-MSFT

Reputation: 692

For the issue that the image cannot be displayed in the MAUI Windows project, you need to confirm the following steps:

1.Image file is placed in the Resources->Images folder.

  1. In the .csproj file, confirm that the image path is in the , taking the dotnet_bot.svg as the example:
<ItemGroup>
    <MauiImage Update="Resources\Images\dotnet_bot.svg"/>
</ItemGroup/>
  1. Make sure the name is correct when using image in your project's Pages:
<Image Source="dotnet_bot.png"/>

For more settings about image in MAUI, you can refer to MAUI Image.

Upvotes: 0

Related Questions