WindowsAppSDK
WindowsAppSDK copied to clipboard
Errors with multiple appExtensions for widgets
Describe the bug
Hello, I noticed that Dev Home app has a few groups of widgets in Widgets boards. You need to install extensions to enable more widgets.
I wanted to create similar solution and put everything in one solution without creating extensions for my app, so I declared more appExtensions with different Ids and widget definition ids:
<uap3:Extension Category="windows.appExtension">
<uap3:AppExtension Name="com.microsoft.windows.widgets" DisplayName="CsConsoleWidgetProvider" Id="winappsdk.cs.console.sample" PublicFolder="Public">
<uap3:Properties>
<WidgetProvider>
<ProviderIcons>
<Icon Path="Assets\StoreLogo.png" />
</ProviderIcons>
<Activation>
<!-- Apps exports COM interface which implements IWidgetProvider -->
<CreateInstance ClassId="80DAE84C-DE3C-4F02-8ECD-DCDD1CDECC15" />
</Activation>
<Definitions>
<Definition Id="CSharp_Counting_Widget"
DisplayName="Sample Counting Widget (C#)"
Description="Counting Widget Description (C#)">
<Capabilities>
<Capability>
<Size Name="small" />
</Capability>
<Capability>
<Size Name="medium" />
</Capability>
<Capability>
<Size Name="large" />
</Capability>
</Capabilities>
<ThemeResources>
<Icons>
<Icon Path="ProviderAssets\Counting_Icon.png" />
</Icons>
<Screenshots>
<Screenshot Path="ProviderAssets\Counting_Screenshot.png" DisplayAltText="For accessibility" />
</Screenshots>
<!-- DarkMode and LightMode are optional -->
<DarkMode />
<LightMode />
</ThemeResources>
</Definition>
<Definition Id="CSharp_Weather_Widget"
DisplayName="Sample Weather Widget (C#)"
Description="Weather Widget Description (C#)">
<Capabilities>
<Capability>
<Size Name="medium" />
</Capability>
<Capability>
<Size Name="large" />
</Capability>
</Capabilities>
<ThemeResources>
<Icons>
<Icon Path="ProviderAssets\Weather_Icon.png" />
</Icons>
<Screenshots>
<Screenshot Path="ProviderAssets\Weather_Screenshot.png" DisplayAltText="For accessibility" />
</Screenshots>
<!-- DarkMode and LightMode are optional -->
<DarkMode />
<LightMode />
</ThemeResources>
</Definition>
</Definitions>
</WidgetProvider>
</uap3:Properties>
</uap3:AppExtension>
</uap3:Extension>
<uap3:Extension Category="windows.appExtension">
<uap3:AppExtension Name="com.microsoft.windows.widgets" DisplayName="CsConsoleWidgetProvider2" Id="winappsdk.cs.console.sample2" PublicFolder="Public">
<uap3:Properties>
<WidgetProvider>
<ProviderIcons>
<Icon Path="Assets\StoreLogo.png" />
</ProviderIcons>
<Activation>
...
It compiles correctly without any manifest validation errors, and I can see all declared extensions as groups of widgets in the widget picker. However, there seems to be an issue. Is there a limit to the number of such extensions in the package manifest? I encounter errors when I add more than 3-5 appExtensions. Sometimes, the widgets board fails to load widgets. The second error occurs when I add a few widgets, close the board, and then reopen it. Instead of pinned widgets, I only see this message:
I modified official sample (https://github.com/microsoft/windowsappsdk-samples/tree/main/Samples/Widgets) and attached it below. You also can see my errors here: YouTube
Steps to reproduce the bug
- Debug attached solution
- Pin a few widgets from solution to the Widgets board
- Hide and show board again
Expected behavior
No response
Screenshots
No response
NuGet package version
Windows App SDK 1.5.5: 1.5.240627000
Packaging type
Packaged (MSIX)
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022
Additional context
Tested on following versions of MicrosoftWindows.Client.WebExperience:
- 524.13200.0.0
- 524.18000.0.0
- 524.19900.0.0