ClickOnce Publish Options Allow URL Parameter to be passed to application is disabled

Sairath Bhattacharjya 52 Reputation points
2023-01-17T22:39:51.37+00:00

Hey everyone,

I am working on a windows form application and for publish and deploy I am using ClickOnce. The app is build using .NET6. One of the requirement is to pass parameters to the app from web, example

https://localhost/companyapps/testapp.application?testId=17170

I am trying to get the testId when the app is loaded in Program.cs Main function. I searched and every post says that we need to enable this option to allow URL params, but in VS2022 its disabled. Also, the code examples that I see online are not applicable for .NET6. Could someone please guide me on how I can get this to work?

Thanks in advance,

Sairath

User's image

Developer technologies | Windows Forms
{count} votes

Accepted answer
  1. Reza Aghaei 4,986 Reputation points MVP Volunteer Moderator
    2023-01-18T10:56:02.2733333+00:00

    I had the same issue, but after installing the latest update of VS 2022, the issue fixed.

    Here is my VS version, which works as expected:

    • Microsoft Visual Studio Professional 2022 (64-bit) - Current Version 17.4.4
    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Sairath Bhattacharjya 52 Reputation points
    2023-01-18T15:40:57.5233333+00:00

    Thanks everyone, that resolved my issue


Your answer

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