"The object reference is not set to an instance of an object" error during ClickOnce Online application installation

Thomas S-G 25 Reputation points
2023-04-17T08:10:15.9433333+00:00

Hello,
I have customers who have installed one of our applications via ClickOnce offline on their computer. We recently published a new version of that ClickOnce but this time online, taking care to change its name in order to avoid possible conflicts during installation. However, we have a problem that only occurs when ClickOnce is first installed. This problem occurs at the very end of the installation, just after the "Preparing the application" message. In the logs, we unfortunately do not have enough information to determine the source of the problem (cf the end of this description : "The object reference is not set to an instance of an object"). After this crash, if the user installs this ClickOnce again, it happens without any problem (after downloading again the resources). I was also able to observe that when the error occurs, all the files have been cached in %AppData%\Local\Apps\2.0..., but are all deleted just at the time of the crash of the installation... We have more than 30.000 customers who use this application and we cannot ask them to launch the installation 2 times each monthly update and we cannot clean the cache before the installation via the command "rundll32 %windir%\system32\dfshim.dll CleanOnlineAppCache" since it would also delete the cache of other applications that are not ours.

Do you have any leads regarding this issue ? Thanks in advance !

Errors logs :

RÉSUMÉ DES APPLICATIONS

* Application en ligne uniquement. 	
* Le paramètre de l'url de confiance est défini. 

RÉSUMÉ DES ERREURS 	
Un résumé des erreurs est fourni ci-dessous. Les détails de ces erreurs sont indiqués plus loin dans le fichier journal. 	

* L'activation de https://monUrl/monApplication.application?MESPARAMS=mesparams a provoqué une exception. Les messages d'erreur suivants ont été détectés : 	
  + La référence d'objet n'est pas définie à une instance d'un objet.  

RÉSUMÉ DES ERREURS DE LA TRANSACTION DU MAGASIN DE COMPOSANTS 	
Aucune erreur de transaction n'a été détectée. 

AVERTISSEMENTS 	
Aucun avertissement n'a été émis pendant cette opération.  

ÉTAT DE LA PROGRESSION DE L'OPÉRATION
* [06/04/2023 16:41:49] : L'activation de https://monUrl/monApplication.application?MESPARAMS=mesparams a commencé. 
* [06/04/2023 16:41:49] : Traitement du manifeste de déploiement terminé. 	
* [06/04/2023 16:41:49] : L'installation de l'application a commencé. 	
* [06/04/2023 16:41:54] : Traitement du manifeste de l'application terminé. 	
* [06/04/2023 16:41:57] : Une version 4.0.30319 du runtime compatible a été trouvée. 	
* [06/04/2023 16:41:57] : Requête de confiance et détection de plateforme terminée. 	
* [06/04/2023 16:42:48] : Téléchargement des dépendances d'abonnement terminé. 	
* [06/04/2023 16:42:48] : La validation de l'application téléchargée a commencé.  

DÉTAILS DE L'ERREUR 	
Les erreurs suivantes ont été détectées au cours de cette opération. 	

* [06/04/2023 16:46:08] System.NullReferenceException 		
    - La référence d'objet n'est pas définie à une instance d'un objet. 		
    - Source : System.Deployment 		
    - Trace de la pile : 			
à System.Deployment.Application.SubscriptionStore.CommitApplication(SubscriptionState& subState, CommitApplicationParams commitParams) 			à System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc) 
à System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl, Uri& deploymentUri) 
à System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée --- 			
à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 			
à System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl) 			
à System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
Windows for business Windows Client for IT Pros User experience Other
Developer technologies .NET Other
Developer technologies Visual Studio Other
{count} votes

Accepted answer
  1. Limitless Technology 44,746 Reputation points
    2023-04-18T14:49:57.7166667+00:00

    Hello there, The error message "Object reference not set to an instance of an object" means that perhaps you're referring to an object that doesn't exist or cleaned up, or was deleted. If you receive the "Object reference not set to an instance of an object" error on your Windows computer, it might be caused by a problem with your .NET Framework. This can be fixed by uninstalling and reinstalling the .NET Framework. This article introduces common errors that can occur when you deploy ClickOnce application, and provides steps to resolve each problem. https://learn.microsoft.com/en-us/troubleshoot/developer/visualstudio/ide/troubleshoot-clickonce-deployments Hope this resolves your Query !! --If the reply is helpful, please Upvote and Accept it as an answer--


0 additional answers

Sort by: Most helpful

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.