PC Review


Reply
Thread Tools Rate Thread

Application.Restart on ClickOnce Deployed Application

 
 
=?Utf-8?B?TmVpbEc=?=
Guest
Posts: n/a
 
      5th May 2006
We've got an application that we deploy with click once.
Using the MyApplication_UnhandledException we restart the application with
Windows.Forms.Application.Restart() if the user encounters an error we
didn't catch.

Our application allows paramaters to be passed to the ClickOnce Application
We are retrieving these like this..
If My.Application.IsNetworkDeployed Then
Dim zUri As New
Uri(My.Application.Deployment.ActivationUri.AbsoluteUri)
zstrQuery = zUri.Query
zarr_strArgs = zstrQuery.Split("&".ToCharArray)
Else....

This works fine when the appliciation is started the first time. After a
restart though, it appears that there is no ActivationUri.AbsoluteUri and I
recieve an "Object reference not set to an instance of an object" error.

What's going on? The documentation states,
"Applications are restarted in the context in which they were initially run.
If your application was started using a URL pointing directly to the
application's main executable file, it will be restarted using the same URL.
If your application is a ClickOnce application, it will be restarted using
ClickOnce.

If your application was originally supplied command-line options when it
first executed, Restart will launch the application again with the same
options."

The way I read this, it should activate the same way it did the first time,
so why is there no Uri?


--
Neil
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Install location of ClickOnce deployed application Jonas Bergman Microsoft Dot NET Framework 0 3rd Jul 2009 10:25 AM
How do I resolve a "401" error on a ClickOnce deployed application Bill Fuller Microsoft Dot NET Framework Forms 1 10th Feb 2008 05:42 PM
Debugging a ClickOnce deployed application Tom Jones Microsoft C# .NET 2 12th Apr 2007 10:49 PM
Unattended update ClickOnce deployed application farmer Microsoft Dot NET Framework 0 19th Apr 2006 12:33 AM
ClickOnce - Application.restart baerland@gmail.com Microsoft Dot NET Framework Forms 0 21st Feb 2006 10:32 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:07 PM.