3

I'm hoping there are some .Net WPF devs out there who can show off their deployment guru knowledge and answer this question. I want to deploy two versions of a WPF desktop application; one live and one test (QA).

We're coming to the end of the initial development of a WPF desktop application that will run within our internal network only. The deployment is to a file share using ClickOnce configured simply via Visual Studio 2017. We have users testing who benefit from the ClickOnce update when we deploy updates (typically bug fixes). When we go live we will set our internal properties to point at a live database instance.

After we have gone live we will start the next phase of development. Then we will need a 'Test' version alongside the now 'Live' version on their desktop. We don't know how to do that. Looking at the Microsoft docs it just doesn't seem this use-case is explained. It might be but it's just not clear. A tutorial / walkthrough would be brilliant!

I found one answer on StackOverflow however it is a work-around that requires some overhead. There is a comment there about using Mage but nothing in depth that makes clear what to do and as stated the MSDN documentation is quite broad and with few examples.

David Savage
  • 314
  • 4
  • 13

1 Answers1

3

Based on a related vlog I have documented a solution:

Steps

  • Create a source control (github) branch for the 'Test' version, with 'Live' on master (any branching arrangement should work as long as there are two)
    • git branch Test
    • git push -u origin Test (this could be done once the local changes below are made)
  • In Visual Studio 2017 (VS) under 'Publish... Application' add "Test" postfix to the 'Assembly name'
  • In VS under 'Publish... Publish' add "Test" postfix to the 'Publishing Folder Location' and the 'Installation Folder URL'
  • In VS under 'Publish... Publish... Options...' add "Test" postfix to the 'Product name'

Custom Steps

  • Add "Test" postfix to log file name (we use log4net configured in 'App.config')
    <file value="${LOCALAPPDATA}\\Our_Company\\log-Test.txt" />
  • Any other files or resources used by the application (we don't have any)
  • We have an application icon in 'Resources' that has a different colour for the 'Test' version than the 'Live'

After these steps go ahead and 'Publish' and there are two desktop versions. Then we share the links, to the setup.exe, by email with our users.

Finally, once the test (QA) phase is complete merge the 'Test' branch to 'master' (or whichever branch 'Live' is on) and reverse the renaming steps above (i.e. remove all the "Test" postfixes). And reverse any custom steps too.

David Savage
  • 314
  • 4
  • 13