We're getting an exception while upgrading our ClickOnce application. This only happens randomly for some users. We fix the issue by clearing out the Apps2.0 folder and then installing again. Wondering if anyone has any insight into what might be causing this ClickOnce installation failure.
ERROR DETAILS
Following errors were detected during this operation.
* [2/21/2023 1:46:06 PM] System.Runtime.InteropServices.SEHException
- External component has thrown an exception.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Internal.Isolation.IStore.Transact(IntPtr cOperation, StoreTransactionOperation[] rgOperations, UInt32[] rgDispositions, Int32[] rgResults)
at System.Deployment.Internal.Isolation.Store.Transact(StoreTransactionOperation[] operations, UInt32[] rgDispositions, Int32[] rgResults)
at System.Deployment.Application.ComponentStore.SubmitStoreTransaction(StoreTransactionContext storeTxn, SubscriptionState subState)
at System.Deployment.Application.ComponentStore.SubmitStoreTransactionCheckQuota(StoreTransactionContext storeTxn, SubscriptionState subState)
at System.Deployment.Application.ComponentStore.CommitApplication(SubscriptionState subState, CommitApplicationParams commitParams)
at System.Deployment.Application.SubscriptionStore.CommitApplication(SubscriptionState& subState, CommitApplicationParams commitParams)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl, Uri& deploymentUri)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
RIP ClickOnce...
Here's Microsoft support's answer after several months of investigation:
.Net engineering team met with .NET Framework Servicing shiproom and have shared below updates.
TTD stack trace we collected earlier did not have the information needed to debug the issue. Recapturing the data will take time, to set it up properly and potentially take a few tries for it to be captured properly. At this point we don't have enough data telling us that this is a wide, systemic problem that warrants servicing the .NET Framework, and we acknowledge that it will take you time and energy to give us the data we need for your environment. But we don't have enough users in the wider ecosystem that are facing this issue and shiproom feels that it is highly unlikely that even with the appropriate data from the sites that it would uncover a problem systemic enough to warrant the risk of making changes in this space. The area where we're encountering a failure is in the riskiest part of ClickOnce to in which to make changes.
They have suggested to use MSIX, which might be a better option for you based on long term service and feature availability. I believe the features in MSIX and its support via PowerShell, SCCM and other Windows ecosystem technologies might be a better fit.
In summary:
This is the riskiest part of ClickOnce to change, and Shiproom is unlikely to approve a fix here outside a security fix. We would need very wide customer impact aside from this one having 50-70 calls per month on this issue. Shiproom would only approve something that fixes an issue that breaks a good chunk of the .NET Framework ecosystem given the risk to the area.
Shiproom also cautions that trying to collect the appropriate logs and data is unlikely to expose something that they'd be likely to approve a fix for.
MSIX is a newer option, and we think it is likely the better deployment technology for the company. We would recommend that you consider moving to MSIX even were this issue to magically disappear because it is fully supported by the Windows team and not in the same servicing only mode as ClickOnce. They are actively working on the product.