Passing URI Parameters to WPF App Affecting Deployment

G

Guest

I have created a WPF "stand-alone" application that is deployed via ClickOnce
over http. One of the features I want to take advantage of is the ability to
pass parameters through the activation URI. I have checked the option to
allow this for the project.

Then I use the client to install the app via ClickOnce. Then on subsequent
uses if I want to change the URI parameters, I get a prompt that indicates
that the app was deployed from a different location. If the parameters do
not change, then it works perfectly well.

Is there any way around this?

Thanks for the assistance.
 
L

Linda Liu[MSFT]

Hi,

Based on my understanding, you have a WPF Windows Application project and
publish the application via ClickOnce. Your problem is that after you
install the WPF application on a client machine and active the WPF
application via a URL with changed parameters, you get a prompt indicating
that the application was deployed from a different location. If I'm off
base, please feel free to let me know.

I performed a test on this issue but didn't reproduce the problem. The
following are the steps of my test:

1. Create a WPF Windows Application project and add a TextBox on the
Window1.xaml. In the Window1.xaml.cs file, write down the following code:

public partial class Window1 : System.Windows.Window
{
public Window1()
{
InitializeComponent();
this.Loaded += new RoutedEventHandler(Window1_Loaded);
}

void Window1_Loaded(object sender, RoutedEventArgs e)
{
if (ApplicationDeployment.IsNetworkDeployed)
{
string url =
AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData[
0];
string queryString = (new Uri(url)).Query;
this.textBox1.Text = queryString;
}
}
}

2. Right click the WPF project in the Solution Explorer and choose
Propeties. In the Project Designer, switch to the 'Publish' tab.

3. Type 'http://localhost/WPFApplication/' in the 'Publishing Location'
textbox.

4. Click the Options button. In the Publish Options dialog, select the
checkbox before the 'Allow URL parameters to be passed to application'
option.

5. Publish the application and install it on the local machine.

6. Open IE and type
'http://localhost/WPFApplication/WPFApplication.application?name=value' in
the address bar and press the Enter key.
The WPF application launches and shows '?name=value' in the TextBox.

7. Close the application and change the query string in IE address bar and
press the Enter key.
The WPF application launches again and shows the new query string in the
TextBox.

Is there any difference between your application and mine? You may also
have a try creating a new simple WPF Windows Application project to see if
the problem still exists.

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.
 
G

Guest

You are correct in understanding what the problem is.

I have taken the code you posted and created a new WPF app named "paramtest".

I then published and installed the application using
http://localhost/WPFApplication.paramtest.application.

Then closed the application and attempted pulling up the app using
http://localhost/WPFApplication.paramtest.application?name=value and received
the incorrect location error below:

- Source: System.Deployment
- Stack trace:
at
System.Deployment.Application.ApplicationActivator.CheckDeploymentProviderValidity(ActivationDescription actDesc, SubscriptionState subState)
at
System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut)
at
System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Deployment.Application.DeploymentException (DeploymentUriDifferent)
- Running paramtest from
http://localhost/WPFApplication/paramtest.application?name=value is not
allowed because you have already installed it from a different location
http://localhost/WPFApplication/paramtest.application. If you want to run
paramtest from
http://localhost/WPFApplication/paramtest.application?name=value, you must
first uninstall it from Add or Remove Programs and then reinstall it from the
new location. If you reinstall, be aware that your application settings will
be restored to their default settings.
- Source: System.Deployment
- Stack trace:
at
System.Deployment.Application.ApplicationActivator.CheckDeploymentProviderValidity(ActivationDescription actDesc, SubscriptionState subState)



Linda Liu said:
Hi,

Based on my understanding, you have a WPF Windows Application project and
publish the application via ClickOnce. Your problem is that after you
install the WPF application on a client machine and active the WPF
application via a URL with changed parameters, you get a prompt indicating
that the application was deployed from a different location. If I'm off
base, please feel free to let me know.

I performed a test on this issue but didn't reproduce the problem. The
following are the steps of my test:

1. Create a WPF Windows Application project and add a TextBox on the
Window1.xaml. In the Window1.xaml.cs file, write down the following code:

public partial class Window1 : System.Windows.Window
{
public Window1()
{
InitializeComponent();
this.Loaded += new RoutedEventHandler(Window1_Loaded);
}

void Window1_Loaded(object sender, RoutedEventArgs e)
{
if (ApplicationDeployment.IsNetworkDeployed)
{
string url =
AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData[
0];
string queryString = (new Uri(url)).Query;
this.textBox1.Text = queryString;
}
}
}

2. Right click the WPF project in the Solution Explorer and choose
Propeties. In the Project Designer, switch to the 'Publish' tab.

3. Type 'http://localhost/WPFApplication/' in the 'Publishing Location'
textbox.

4. Click the Options button. In the Publish Options dialog, select the
checkbox before the 'Allow URL parameters to be passed to application'
option.

5. Publish the application and install it on the local machine.

6. Open IE and type
'http://localhost/WPFApplication/WPFApplication.application?name=value' in
the address bar and press the Enter key.
The WPF application launches and shows '?name=value' in the TextBox.

7. Close the application and change the query string in IE address bar and
press the Enter key.
The WPF application launches again and shows the new query string in the
TextBox.

Is there any difference between your application and mine? You may also
have a try creating a new simple WPF Windows Application project to see if
the problem still exists.

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.
 
L

Linda Liu[MSFT]

Hi,

Thank you for your feedback!
I then published and installed the application using
http://localhost/WPFApplication.paramtest.application.

It seems that the URL should be
"http://localhost/WPFApplication/paramtest.application". You may miswrote
it, right?

Could you please tell me what the OS is on your machine? I have performed
tests publishing the WPF application via ClickOnce to both Windows Vista
and XP, and installing the application on the same machine. The WPF
application is activated properly no matter what the URL and query string
is I use to launch the application.

I suggest you have a try on another machine, i.e. publish the WPF
application to another machine and then install the application via
ClickOnce on that machine to see if the problem still exits.

To narrow down the problem, you may also perform a test on WinForm
application to see if the problem exists.

Sincerely,
Linda Liu
Microsoft Online Community Support
 
L

Linda Liu[MSFT]

Hi,

How about the problem now?

If the problem is still not resolved, please feel free to let me know.

Thank you for using our MSDN Managed Newsgroup Support Service!

Sincerely,
Linda Liu
Microsoft Online Community Support
 
G

Guest

Sorry for the delay in getting back to you. I had to work with our IT dept
to get another environment setup to test this.

We created a completely separate environment, running WinXP SP2, IE7, .NET
3.5 and all latest updates. I then published the test app to that machine,
and installed on the machine using ClickOnce through IE7. Note: When
installing I did not specify any URI parameters (i.e.
http://server/app/app.application).

Once installed, I then closed the app, and re-opened IE7, and went to the
same URI, only this time I added "?param=value" (i.e.
http://server/app/app.application?param=value). I then get the message
metioned in the first post. Still no luck...
 
L

Linda Liu[MSFT]

Hi,

Thank you for your feedback!

I have searched our internal database, but didn't find a simliar issue in
it.

To narrow down this problem, I suggest that you perform a test on WinForm
application to see if the problem still exists.

If the problem still exists, could you please send me a sample WPF
application project that could just reproduce the problem? To get my actual
email address, remove 'online' from my displayed email address.

Sincerely,
Linda Liu
Microsoft Online Community Support
 
L

Linda Liu[MSFT]

Hi Justin,

I performed a test on your sample application and did reproduce the problem
on my side.

I install the ClickOnce application via a URL without any query string and
then try to launch the installed application via a URL with a query string.
At this time I get the same exception as you got.

Since that you create and deploy the application using VS2008 Beta2, it
seems that this problem is related to this version of VS. This problem
doesn't exist in VS2005, so I suggest that you use VS2005 to create and
deploy the application.

Since we don't support VS2008 Beta, you may submit a bug report in the
Microsoft connect web stie via the following link:

http://connect.microsoft.com/VisualStudio/Feedback

Thank you for understanding and support for Microsoft!

If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support
 
S

Sebastian Gurgul

Hi,

We observe exactly the same problem after installing recent Windows Updates.
The problem is that we are using VS2005.

We develop ClickOnce application for a long time and we have a stable
deployment infrastructure which was not change since few months. Recently we
observe the below mentioned exception related to different deployment
location. We need to pass session ID through application URL to implement
stateful web services.

We suspect the update .NET 2.0 Service Pack 1 (kb110806). Before installing
it everything works fine.

Exception:
Following errors were detected during this operation.
* [2007-12-19 15:34:28] System.Deployment.Application.DeploymentException
(DeploymentUriDifferent)
- You cannot start application e-Office Document Management from this
location because it is already installed from a different location.
- Source: System.Deployment
- Stack trace:
at
System.Deployment.Application.ApplicationActivator.CheckDeploymentProviderValidity(ActivationDescription actDesc, SubscriptionState subState)
at
System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri
activationUri, Boolean isShortcut, String textualSubId, String
deploymentProviderUrlFromExtension)
at
System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Deployment.Application.DeploymentException (DeploymentUriDifferent)
- You cannot start application e-Office Document Management from location
http://10.10.10.56/eOffice/Document...ice.asmx&sid=51EB71D2A7BB7D0986C98CB3A3F69F15
it is already installed from location
http://siphon/eOffice/DocumentManag...ice/DocumentManagement/Service/DMService.asmx.
You can start it from location
http://siphon/eOffice/DocumentManag...ice/DocumentManagement/Service/DMService.asmx
or you can uninstall it and reinstall it from location
http://10.10.10.56/eOffice/Document...ice.asmx&sid=51EB71D2A7BB7D0986C98CB3A3F69F15.
If you reinstall the application, be aware that you might lose any
customizations that you made to the application.
- Source:
- Stack trace:
 
S

Sebastian Gurgul

Of course even if the URLs are exactly the same (with the exception of SID
parameter value) the problem still occurs - see log below. The previous log
was not the best due to the different order of the parameters and host
name/ip.

S.Gurgul

OPERATION PROGRESS STATUS
* [2007-12-19 16:10:59] : Activation of
http://10.10.10.56/eOffice/Document...ice.asmx&sid=73094F08BC5A36630E393CD5A0608E37 has started.
* [2007-12-19 16:10:59] : Processing of deployment manifest has
successfully completed.

ERROR DETAILS
Following errors were detected during this operation.
* [2007-12-19 16:10:59] System.Deployment.Application.DeploymentException
(DeploymentUriDifferent)
- You cannot start application e-Office Document Management from this
location because it is already installed from a different location.
- Source: System.Deployment
- Stack trace:
at
System.Deployment.Application.ApplicationActivator.CheckDeploymentProviderValidity(ActivationDescription actDesc, SubscriptionState subState)
at
System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri
activationUri, Boolean isShortcut, String textualSubId, String
deploymentProviderUrlFromExtension)
at
System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Deployment.Application.DeploymentException (DeploymentUriDifferent)
- You cannot start application e-Office Document Management from location
http://10.10.10.56/eOffice/Document...ice.asmx&sid=73094F08BC5A36630E393CD5A0608E37
it is already installed from location
http://10.10.10.56/eOffice/Document...ice.asmx&sid=7FF582994463E709DD17A8844AF90B66.
You can start it from location
http://10.10.10.56/eOffice/Document...ice.asmx&sid=7FF582994463E709DD17A8844AF90B66
or you can uninstall it and reinstall it from location
http://10.10.10.56/eOffice/Document...ice.asmx&sid=73094F08BC5A36630E393CD5A0608E37.
If you reinstall the application, be aware that you might lose any
customizations that you made to the application.

Sebastian Gurgul said:
Hi,

We observe exactly the same problem after installing recent Windows Updates.
The problem is that we are using VS2005.

We develop ClickOnce application for a long time and we have a stable
deployment infrastructure which was not change since few months. Recently we
observe the below mentioned exception related to different deployment
location. We need to pass session ID through application URL to implement
stateful web services.

We suspect the update .NET 2.0 Service Pack 1 (kb110806). Before installing
it everything works fine.

Exception:
Following errors were detected during this operation.
* [2007-12-19 15:34:28] System.Deployment.Application.DeploymentException
(DeploymentUriDifferent)
- You cannot start application e-Office Document Management from this
location because it is already installed from a different location.
- Source: System.Deployment
- Stack trace:
at
System.Deployment.Application.ApplicationActivator.CheckDeploymentProviderValidity(ActivationDescription actDesc, SubscriptionState subState)
at
System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri
activationUri, Boolean isShortcut, String textualSubId, String
deploymentProviderUrlFromExtension)
at
System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Deployment.Application.DeploymentException (DeploymentUriDifferent)
- You cannot start application e-Office Document Management from location
http://10.10.10.56/eOffice/Document...ice.asmx&sid=51EB71D2A7BB7D0986C98CB3A3F69F15
it is already installed from location
http://siphon/eOffice/DocumentManag...ice/DocumentManagement/Service/DMService.asmx.
You can start it from location
http://siphon/eOffice/DocumentManag...ice/DocumentManagement/Service/DMService.asmx
or you can uninstall it and reinstall it from location
http://10.10.10.56/eOffice/Document...ice.asmx&sid=51EB71D2A7BB7D0986C98CB3A3F69F15.
If you reinstall the application, be aware that you might lose any
customizations that you made to the application.
- Source:
- Stack trace:


Linda Liu said:
Hi Justin,

I performed a test on your sample application and did reproduce the problem
on my side.

I install the ClickOnce application via a URL without any query string and
then try to launch the installed application via a URL with a query string.
At this time I get the same exception as you got.

Since that you create and deploy the application using VS2008 Beta2, it
seems that this problem is related to this version of VS. This problem
doesn't exist in VS2005, so I suggest that you use VS2005 to create and
deploy the application.

Since we don't support VS2008 Beta, you may submit a bug report in the
Microsoft connect web stie via the following link:

http://connect.microsoft.com/VisualStudio/Feedback

Thank you for understanding and support for Microsoft!

If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top