robertb_NZ
Well-known member
I have a ClickOnce application published with option "The application is available offline as well". When run from the web page it is passed a URI query, so I need to know if it is being run offline, or from Visual Studio. I have the following code, which works, but is there a better way that doesn't use Try/Catch, to avoid relying on error trapping for "normal logic".
If System.Diagnostics.Debugger.IsAttached Then ' Case 1: Debugging (run from Visual Studio)
Thank you, Robert.
If System.Diagnostics.Debugger.IsAttached Then ' Case 1: Debugging (run from Visual Studio)
' Set Debugging defaults
ElseTry ' Case 2. Run from JazzSoftware web page.
End IfQueryString = ApplicationDeployment.CurrentDeployment.ActivationUri.Query
HandleParameters() ' Parameter received with download
' Encrypt and save query string
Catch ex As Exception ' Case 3. Run downloaded copy offlineHandleParameters() ' Parameter received with download
' Encrypt and save query string
QueryString = Decrypt(saved query string)
HandleParameters()
End TryHandleParameters()
Thank you, Robert.