Disable URL activation of ClickOnce applications by using the Designer
Typically, a ClickOnce application will start automatically immediately after it is installed from a Web server. For security reasons, you may decide to disable this behavior, and tell users to start the application from the Start menu instead. The following procedure describes how to disable URL activation.
This technique can be used only for ClickOnce applications installed on the user's computer from a Web server. It cannot be used for online-only applications, which can be started only by using their URL. For more information about the difference between online-only and installed applications, see Choosing a ClickOnce Deployment Strategy.
This procedure uses Visual Studio. You can also accomplish this task by using the Windows Software Development Kit (SDK). For more information, see How to: Disable URL Activation of ClickOnce Applications.
Procedure
To disable URL activation for your application
Right-click your project name in Solution Explorer, and click Properties.
On the Properties page, click the Publish tab.
Note
In ClickOnce for .NET Core 3.1 and .NET 5 or later, you set deployment properties using the Publish tool instead of the Publish wizard and the Publish page of the Project Designer. For more information, see Deploy a .NET Windows application using ClickOnce and ClickOnce for .NET.
Click Options.
Click Manifests.
Select the check box labeled Block application from being activated via a URL.
Deploy your application.