Bonjour,

J'aimerai savoir comment faire pour récupérer dans tous les cas l'URL de déploiement de ClickOnce. Je m'explique :

j'ai un application déployée sous ClickOnce. Lorsque je clic sur le lien de ma page HTML je récupère bien mon url avec le code suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
 
LabelURL.Text = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData(0)
Le problème est que lorsque je clic sur le raccourci qui est créé dans mon menu démarrer, j'ai l'erreur suivante :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
L'exception System.InvalidOperationException n'a pas été gérée
  Message="Une erreur s'est produite lors de la création du formulaire. Pour plus d'informations, consultez Exception.InnerException. L'erreur est*: La référence d'objet n'est pas définie à une instance d'un objet."
  Source="LancementTest"
  StackTrace:
       à LancementTest.My.MyProject.MyForms.Create__Instance__[T](T Instance) dans 17d14f5c-a337-4978-8281-53493378c1071.vb:ligne 190
       à LancementTest.My.MyProject.MyForms.get_LancementTest()
       à LancementTest.My.MyApplication.OnCreateMainForm() dans C:\Documents and Settings\flaw35\Mes documents\Visual Studio 2005\Projects\LancementTest\LancementTest\My Project\Application.Designer.vb:ligne 35
       à Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       à Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       à Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       à LancementTest.My.MyApplication.Main(String[] Args) dans 17d14f5c-a337-4978-8281-53493378c1071.vb:ligne 81
       à System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       à System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
       à System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
       à System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
       à System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
       à System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
       à Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
       à System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       à System.Threading.ThreadHelper.ThreadStart()
Merci d'avance pour votre aide