microsoft / microsoft/WindowsAppSDK-Samples

Pinning widget after deploy rise NullReferenceException

Open
#322 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
1k
Forks
335
Avg merge
5d 1h
Merged PRs (30d)
8

Description

After first deploy, try to pin the widget. The console app will open and rise null exception in this line:
https://github.com/microsoft/WindowsAppSDK-Samples/blob/3de5dd96cacf89cc29b3f4f5d982ec8cc58711ff/Samples/Widgets/cs-console-packaged/CsConsoleWidgetProvider/WidgetProvider.cs#L28

then will be called Activate method and trow error Activate called for unknown:
https://github.com/microsoft/WindowsAppSDK-Samples/blob/3de5dd96cacf89cc29b3f4f5d982ec8cc58711ff/Samples/Widgets/cs-console-packaged/CsConsoleWidgetProvider/WidgetProvider.cs#L151

After killing widget.exe process two times (Exactly twice, once is not enough) the error always goes away.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Samples/Widgets/cs-console-packaged/CsConsoleWidgetProvider/WidgetProvider.cs, especially the referenced lines 28 and 151. Reproduce by pinning the widget after the first deploy, inspect the null exception and the subsequent “Activate called for unknown” error, and verify the behavior without requiring two widget.exe process terminations.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.