I have a Windows Forms application developed using C# in .NET framework 3.5, Service pack 1. The application can be published based on the development database as well as the production database. I am using MSBuild community tasks to publish my application. I do not face any problems while publishing the application to different location, namely a development location and a production location.
Issue:
After installing the development application into my machine, I am unable to install the production application. It gives me an error saying:
You cannot start application TEST from this location because it is already installed from a different location
Question: How does the machine understand that I am trying to install the same application? I assume it has some kind of an Application Id. If that's the case, I can override the concerned value based on the location. (DEV or PROD)
The current code while publishing in the project file of my application:
<Choose> <When Condition=" '$(BuildEnvironment)' == 'DEV' "> <PropertyGroup> <PublishDir>\\A\B\development\</PublishDir> <BaseConnection>Data Source=SQL-DEV.company.com; Database=TEST;Uid=XYZ;Pwd=ABC;</BaseConnection> </PropertyGroup> </When> <When Condition=" '$(BuildEnvironment)' == 'PROD' "> <PropertyGroup> <PublishDir>\\A\B\production\</PublishDir> <BaseConnection>Data Source=SQL-PROD.company.com;; Database=TEST;Uid=XYZ;Pwd=ABC;</BaseConnection> </PropertyGroup> </When> </Choose>
The publishing of the application works like a charm and points to the concerned database. All I want to do now is be able to install the development application as well as production application on the same machine without any errors.
Question: What differentiates one click once application with the other?