tags:

views:

181

answers:

2

I want to publish a beta version of my application every time it builds, so users can access the "beta" version and test features out before a general release.

I tried doing this by overriding the ProductName while running it to [product]-beta. The problem is the Publish process still creates a [product].application and it seems that the ClickOnce magic doesn't know the difference between a [product].application on one URL and a [product].application on another.

Any idea of how I would get around this?

+2  A: 

I ran into a very similar problem and here is the solution I came up with.

I put all of my GUI forms into a DLL including the main startup form. I then created 2 EXE projects which reference my GUI dll. One has the name Product and the other ProductBeta.
The code in the EXE is virtually the same between both of them. Namely Application.Run(new MainForm()).

I then set them to publish to sub-directories on the same share.

It's annoying and has a bit of overhead but the results work very well.

JaredPar
+1  A: 

As you've discovered, modifying the product name isn't sufficient. You need to modify the assembly name.

Details from http://weblogs.asp.net/sweinstein/archive/2008/08/24/top-5-secrets-of-net-desktop-deployment-wizards.aspx

The most important thing is having support for multiple environments - this isn't built in, and if you attempt to deploy two different ClickOnce builds with the same deployment name to different sites, the latest build will take precedence and effectively overwrite the existing deployment on the desktop.

The fix for this is relatively straightforward - you need to provide different deployment name for each build. Like so -

<MSBuild 
   Projects="ClickOnce.csproj"
   Targets="Publish"
   Properties="
            MinimumRequiredVersion=$(MinimumRequiredVersion);
            ApplicationVersion=$(ApplicationVersion);
            ApplicationRevision=$(ApplicationRevision);
            CodeBranch=$(CodeBranch);
            DeployEnv=$(DeployEnv)
            AssemblyName=ClickOnce.$(DeployEnv);
            PublishUrl=$(PublishUrl);
            ProductName=ClickOnce $(CodeBranch) $(DeployEnv)" />

The one limitation of this approach is that project references will no longer work. Use file based assembly refs, and it'll be fine.

Scott Weinstein