WPF NET5 ClickOnce FileAssociation Get file name command line args

Viewed 154

In WPF .NET5 ClickOnce publish I have added an FileAssociation

i.e:

<FileAssociation Include=".text">
  <Visible>false</Visible>
  <Description>prosjekt text</Description>
  <Progid>text</Progid>
  <DefaultIcon>icon.ico</DefaultIcon>
</FileAssociation>

When clicking a file in FileExplorer my app launches fine.

Now I need the filepath for the file. Im not able to retrieve the file name in the application. Looking at threads on WPF, clickonce .net framework, they refer to doing this: AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData[0]

But this is not available in .net5? Or maybe im missing a package?

Im not getting the file name via Environment.GetCommandLineArgs() or StartupEventArgs either.

0 Answers
Related