1

I'm making a WinUI3 app in Visual Studio, and I'd like to open a file when I start debugging, so that activatedEventArgs.Kind == ExtendedActivationKind.File as per this.

I'm really struggling to turn anything up with google, so am making a question here to help the next person.

Andrew KeepCoding
  • 7,040
  • 2
  • 14
  • 21
Siyh
  • 1,747
  • 1
  • 17
  • 24

1 Answers1

2

Assuming that you already registered your file type (by following the steps in the link you provided) and your target app is already deployed (when run on VS), you can debug it this way:

  1. In VS, go to Debug > Other Debug Targets > Debug Installed Debug Package...

  2. Select your app in Installed App Packages.

  3. Select Managed(.NET Core, .NET 5+) in Debug this code type.

  4. Check Do not launch, but debug my code when it starts.

  5. Click Start. (The debugger starts running without launching your app.)

  6. Double-click your target file. (Your app launches and the VS attaches the debugger to you app).

Andrew KeepCoding
  • 7,040
  • 2
  • 14
  • 21