user3859666
user3859666

Reputation: 279

Application cannot be started

I have a windows application deployed through ClickOnce at one location (dev server). The same version is deployed at another location as well (test server).

I am not able to install two versions (dev and test) on the same machine. I am getting a error like "Application cannot be started". If select the details button, it is showing "Application is installed from different location".

Can I install two different versions on same machine at the same time? For example, I need to install both - dev version and test version - on same machine without uninstalling any of them.

Upvotes: 1

Views: 725

Answers (1)

heathesh
heathesh

Reputation: 1041

If you want to install two different versions on the same machine, you need to do three things before you publish your ClickOnce packages:

  1. Each version needs it's own "Assembly Name" on the properties page

Right Click Project -> Select "Properties" -> Select "Application" tab -> Change "Assembly name" to something like "[YourCurrentAssemblyName].Dev"

  1. Each version will need to have it's own "Product Name" in the publish properties

Right Click Project -> Select "Properties" -> Select "Publish" tab -> Select "Options" -> In the "Description" section, change the "Product name" to something like "[YourCurrentApplicationName] Dev"

  1. Each version will need a unique assembly guid in the applications assembly.cs file

Expand your project "Properties" in the solution explorer and open up your "Assembly.cs" file. Find the following line:

[assembly: Guid("D3461344-B663-4698-B32B-F52041D7B093")]

Change the guid there to something different, which you must remember for each environment. So every time you build for dev it should use the same guid it used before, but the guid should be different for each environment.

You should be able to build your project and publish it for different environments if you follow these steps.

Upvotes: 1

Related Questions