Hello,
Not only for the application icon, I want to use SVG in the entire application where the icon is used.
.NET MAUI converts SVG files to PNG files. Therefore, when adding an SVG file to your .NET MAUI app project, it should be referenced from XAML or C# with a .png extension.
Please add the svg
file into your MAUI project, and set the build action to MauiImage
, then set teh source for the Image.
For example, I add a pantssvgrepocom.svg file in my project, and use it like the following:
<Image
Source="pantssvgrepocom.png"
... />
For more details, please refer to Add images to a .NET MAUI app project - .NET MAUI | Microsoft Learn
Best Regards,
Wenyan Zhang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.