Hi Nath Moore,
ClickOnce applications operate through a specialized deployment manifest rather than a direct executable launch, which means standard command-line flags are inherently stripped during the initialization sequence. Even though Task Manager displays a standard executable running, the actual binary is buried deep within the dynamically generated local application data directory, specifically located at %LocalAppData%\Apps\2.0, making direct argument passing impossible through traditional execution methods.
To resolve this, you must modify the deployment behavior within Visual Studio 2022. Navigate to your project properties, access the Publish section, open the Options menu, and explicitly enable the setting to allow URL parameters to be passed to the application. This modifies the deployment manifest to safely pipeline external arguments through the ClickOnce launcher without breaking the deployment integrity or security model.
Once the manifest is configured to allow external parameters, your source code must be adapted to intercept them from the activation context rather than standard executable arguments. Traditional string array arguments retrieved on startup will remain empty, so your application must invoke the current application domain setup information to retrieve the activation data directly. Implementing this parameter interception within your initialization code will ensure the flags are processed successfully, allowing your dual-application workflow to bind to the shared ports and maintain peak performance.
Hope this answer brought you some useful information. If it did, please hit “accept answer”. Should you have any questions, feel free to leave a comment.
VP