ClickOnce complains: "You cannot start application from this location because it is already installed from a different location."
Asked Answered
M

6

8

I have a ClickOnce install of a .NET 4.0 application. I got this error:

You cannot start application from this location because it is already installed from a different location

I got it by doing the following: * I create my deployment and zip it. * Go to an install computer and unzip and install. * Create the next version and zip that up. * Now on my install computer, if I unzip to a different location and try to run setup, I get the above error.

I would be perfectly fine with having my application completely uninstall previous versions and then install the latest. Would not these types of errors occur all the time where a user installs from a DVD once and later gets a new version via a downloaded ZIP file?

Marzi answered 15/3, 2011 at 1:14 Comment(1)
I think you should read answer for next questionPolyamide
G
9

The deployment URL is part of the identity of the application. If you install it from one location when it starts, you need to install updates from the same location. It does this even if you don't specify a deployment provider in the manifest (as noted in the article referenced by Johnny) -- it just sets it to the place you first install it from.

The only way around this that I know of is to publish the application to a webserver as an online-only application. (Might also work from a file share, but I don't remember.)

Garver answered 29/3, 2011 at 7:2 Comment(1)
What happens when I set ExcludeDeploymentUrl=true? Is this what you mean by "don't specify a deployment provider in the manifest"? I'm wondering if setting ExcludeDeploymentUrl=true has any flexibility benefits.Intolerant
T
1

If you want to install different versions of the same application using ClickOnce at the same time, such as a Dev version and a QA version, then sign each version with unique certificates:

makecert -r -pe -n "CN=MyApp Q1" -sv MyApp-Q1.pvk MyApp-Q1.cer -b 06/01/2016 -e 12/31/2099

Then in powershell to get the thumbprint you would use:

Get-PfxCertificate -FilePath .\MyApp-Q1.pfx

Then have the following in your app csproj file:

<ProductName>MyApp - Q1</ProductName>
<InstallUrl>\\my\installation\link</InstallUrl>
<ManifestCertificateThumbprint>9D4BF3492523A7D45A835542F7E1CB27ED53573B</ManifestCertificateThumbprint>
<ManifestKeyFile>../Certificates/MyApp-Q1.pfx</ManifestKeyFile>

Or alternatively if you prefer a UI-based solution, you can go to the project properties in Visual Studio and click on the Signing tab to add a certificate there. For details, please see MSDN How to: Sign application and deployment manifests (see https://learn.microsoft.com/en-us/visualstudio/ide/how-to-sign-application-and-deployment-manifests?view=vs-2017) or Walkthrough: Manually deploy a ClickOnce application (see https://learn.microsoft.com/en-us/visualstudio/deployment/walkthrough-manually-deploying-a-clickonce-application?view=vs-2017)

Tuning answered 13/2, 2019 at 23:40 Comment(0)
B
1

Maybe Microsoft made this easier since 2011. Now you can click the "Details..." button on the error message.

enter image description here

When you click that button, a text file will open up which will tell you:

ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of C:\Folder2\App.application resulted in exception. Following failure messages were detected:
        + You cannot start application App from this location 
          because it is already installed from a different location.
        + You cannot start application App from location C:\Folder2\App.application 
          it is already installed from location C:\Folder1\App.application.

So now you know the "other" install location that is causing this error.

PS: This is from a .NET Core app in my example.

Barouche answered 19/12, 2022 at 16:15 Comment(0)
G
0

If you are facing this issue that application is already install then you can go to control panel and you and uninstall an existing application and you can install/publish you application.

It worked for me.

Thanks, Rakesh

Gettysburg answered 20/5, 2019 at 10:18 Comment(0)
C
0

As per @RobinDotNet's answer, our location inadvertently changed on the web server.

I received this error because we changed some settings on the web server from which we were deploying the application. Specifically we forced all traffic across to HTTPS. The application was originally installed from HTTP (but could not reach that any longer and was being redirected to HTTPS).

Solution was to uninstall and re-install application from new HTTPS location. I guess if you were desperate, you could re-enable HTTP.

Client answered 8/11, 2020 at 21:59 Comment(0)
A
0

Here's how I got around this problem. I would get the above error message when I would double-click the shortcut icon on my desktop for my app, although it ran the first time that I double-clicked the icon, but not afterwards. I discovered the shortcut linked to a copy of the app files stored on my OneDrive and not on my c: drive. I deleted the shortcut to the OneDrive and replaced it with one that linked to the app files on my c: drive. Now my app runs every time from the desktop icon.

Aluminothermy answered 6/5, 2021 at 8:19 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.