Share via

[uwp] CommandLineActivatedEventArgs getting Arguments exception

Piotr 6 Reputation points
2021-03-28T12:49:20.797+00:00

In this code:

Protected Overrides Async Sub OnActivated(args As IActivatedEventArgs)

      Dim commandLine As CommandLineActivatedEventArgs = TryCast(args, CommandLineActivatedEventArgs)
      Dim operation As CommandLineActivationOperation = commandLine.Operation

       Dim strArgs As String = operation.Arguments

I got exception: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) in last line.
And app is Activated with cmdline with param "00:15:A6:00:xx:xx on".
Is there any possibility to deal with this problem?

Min version: 16299, target version: 19041.

Developer technologies | Universal Windows Platform (UWP)

1 answer

Sort by: Most helpful
  1. Piotr 6 Reputation points
    2021-06-30T07:46:47.967+00:00

    I don't remember :)

    Now, I have

            Dim commandLine As CommandLineActivatedEventArgs = TryCast(args, CommandLineActivatedEventArgs)
            Dim operation As CommandLineActivationOperation = commandLine?.Operation
            Dim strArgs As String = operation?.Arguments
    

    and it works.
    Maybe change in Manifest, I don't know.
    Min version 14393, target version 19041.

    Currently, all my apps have something like that:

      < .. xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
          xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" 
         IgnorableNamespaces="uap mp uap3 uap5">
    
    
        <uap:Extension Category="windows.appService">
          <uap:AppService Name="com.microsoft.pkar.instamonitor"/>
        </uap:Extension>
        <uap5:Extension
          Category="windows.appExecutionAlias"
          Executable="instamonitor.exe"
          EntryPoint="instamonitor.App">
          <uap5:AppExecutionAlias>
            <uap5:ExecutionAlias Alias="instamonitor.exe" />
          </uap5:AppExecutionAlias>
        </uap5:Extension>
    

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.