VB.NET StartupNextInstance and ClickOnce (.NET 2.0)
VB.NET StartupNextInstance and ClickOnce (.NET 2.0):
A call to ApplicationDeployment.CurrentDeployment.ActivationUri.Query
returns same paramaters in event handler MyApplication_StartupNextInstance as
it returns in MyApplication_Startup event handler.
Calls to ApplicationDeployment.CurrentDeployment.ActivationUri.Query in
event handler MyApplication_StartupNextInstance must return the query URL
parameters for applications starts after the initital startup. Meaning after
the inital startup of the application, any additional starts via ClickOnce
URL link with different parameters must be consumable from
MyApplication_StartupNextInstance via
ApplicationDeployment.CurrentDeployment.ActivationUri.Query. So, code has
access to URL query parameters of startups after the initial one.
I've noted a newsgroup response in MSDN Forums >> Windows Forms >> ClickOnce
and Setup & Deplyoment Projects >> StartupNextInstance and ClickOnce dated
23 Aug 2006, 1:21 AM UTC, Patty Lau responded this is a known bug.
Is this a known bug?
If so, is a fix available?
My apologies for reposting but my MSDN alias was not associated with my
account. This was corrected; I want to make sure my message is addressed.
Linda Liu [MSFT] - 24 Jan 2007 08:56 GMT
Hi,
Based on my understanding, you have a ClickOnce deployed VB.NET application
whose 'Make single instance application' feature has been turned on. You
lunch the application via a Url. When you lunch the application for the
first time, the Startup event is fired. When you lunch the application for
the second time, the StartupNextInstance event is raised. The problem is
that the call to
'ApplicationDeployment.CurrentDeployment.ActivationUri.Query' returns the
same result in the handler of the Startup event as it does in that of the
StartupNextInstance event. If I'm off base, please feel free to let me know.
I have performed a test based on my above understanding. I publish the
application to a Web site/ file path. I navigate the web page/shared file
path and lunch the application twice. The result is that the call to
'ApplicationDeployment.CurrentDeployment.ActivationUri.Query' in both the
handlers of Startup and StartupNextInstance events return NULL.
I have found an example on MSDN on how to retrieve the URL parameters by
using ActivationUri. You may have a try on it to see if it could solve your
problem.
'ApplicationDeployment.ActivationUri Property'
http://msdn2.microsoft.com/en-us/library/system.deployment.application.appli
cationdeployment.activationuri.aspx
Hope this helps.
If you have any concerns, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.