.NET: Microsoft Technologies based on the .NET software framework. Runtime: An environment required to run apps that aren't compiled to machine language.
Yes. ClickOnce in .NET Framework 3.5 and later explicitly supports this scenario, with some constraints.
Key points from the platform behavior and guidance:
- Single build and publish, reused across environments
ClickOnce was enhanced so that a third party (the ISV) can create a single signed ClickOnce deployment and then hand it to a customer, who can deploy it from multiple locations on their own network without re-signing or changing the manifests. This is exactly the “build once, deploy to multiple environments” scenario. This feature is intended for:- Updating an application (not the very first install), and
- Situations where only one configuration of the application exists on a given machine (no parallel variants pointing to different backends).
- Do not embed an environment-specific update URL (
deploymentProvider)
The main technical requirement is that the deployment manifest must not contain adeploymentProviderelement. In earlier versions (2.0/3.0), an offline-available ClickOnce app had to specify this element, which effectively hard-wired the update location and forced environment-specific manifests. With .NET Framework 3.5 and later, to enable reuse of the same signed package from different locations:- Exclude
deploymentProviderfrom the deployment manifest. - When using
Mage.exe, omit the-providerUrlargument. - When using
MageUI.exe, leave the Launch Location box blank on the Application Manifest tab.
- Exclude
- How updates work without
deploymentProvider
WhendeploymentProvideris omitted, ClickOnce does not rely on a fixed update URL embedded in the manifest. Instead, the deployment is tied to the location from which it was originally installed. The customer can host the same artifact in different locations (e.g., a UAT URL and a Production URL) and install from each location as needed, without modifying the manifests. - Environment selection at deployment/runtime
ClickOnce itself does not provide a built-in mechanism to dynamically choose an environment URL at install time while keeping a single installed instance per machine. The supported pattern for “build once, deploy many” is:- Build and sign once.
- Omit
deploymentProviderso the same package can be hosted and deployed from multiple locations. - Ensure that each client machine only runs one configuration of the app (for example, not both a UAT and Production variant with different backends) if relying on this feature.
- Security and signing considerations
The identity of a ClickOnce application is based on the digital signature of the deployment manifest. When a single ISV-signed deployment is reused by a customer across environments, that identity and trust chain remain intact, and the customer does not need to re-sign the deployment manifest, avoiding checksum changes. For scenarios where customers must sign their own deployment manifests, Microsoft also documents the alternative model where the ISV signs the application manifest and the customer signs the deployment manifest, but that model does require re-signing and therefore changes checksums.
Summary relative to the stated requirements:
- Build and publish only once: Supported by creating a ClickOnce deployment that omits
deploymentProviderand is signed once. - Promote the exact same signed package from UAT to Production: Supported; the same signed deployment can be copied/hosted in multiple locations without modification or re-signing.
- Avoid environment-specific recompilation/republishing: Supported; no rebuild or republish is required when moving from UAT to Production.
- Resolve environment URL at deployment/runtime without modifying artifacts: Supported in the sense that ClickOnce does not need an environment-specific
deploymentProvider; environment-specific behavior should be handled by the application logic or by where the deployment is hosted, not by changing the ClickOnce manifests.
References:
- Deploy ClickOnce applications for testing and production servers without resigning
- ClickOnce deployment and security
- Create ClickOnce applications for others to deploy
- Walkthrough: Manually deploy a ClickOnce application that does not require re-signing and that preserves branding information
- Walkthrough: Manually deploy a ClickOnce application
- Application Lifecycle Management: From Development to Production