I have a WPF app that runs on Core 3.0. I published it via Windows Application Packaging Project. Because it's WPF app, I needed to add this to appxmanifest:
<Extensions>
<uap5:Extension
Category="windows.appExecutionAlias"
Executable="MyApp.exe"
EntryPoint="MyApp">
<uap5:AppExecutionAlias>
<uap5:ExecutionAlias Alias="MyApp.exe" />
</uap5:AppExecutionAlias>
</uap5:Extension>
</Extensions>
Then I published the WPF app as sideloaded and it works just fine when I start it from the Windows Start menu. The problem is that I need to start it from command line and I need to pass few command line arguments. But, when I start the app from command line by typing the alias, it only passes this argument: -ServerName:App.App7adfdfg54shnsdfh87asrgsdfg1.mca which is not my argument - mine arguments are not passed at all. So then I tried to add this to my WPF .csproj file:
<Reference Include="Windows.Foundation.UniversalApiContract">
<HintPath>C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0\Windows.Foundation.UniversalApiContract\8.0.0.0\Windows.Foundation.UniversalApiContract.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
</Reference>
so I could call this in my WPF App.xaml.cs file:
using test = Windows.ApplicationModel.AppInstance;
...
Windows.ApplicationModel.Activation.IActivatedEventArgs args = test.GetActivatedEventArgs();
But after doing this, args are null. Any ideas how to solve this and actually pass arguments to my WPF app? Thanks.