Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ClickOnce Deployment for different configurations [duplicate]

I'm currently looking at ClickOnce deployment for our WPF application and was wondering, is it possible to set the ProductName and PublishUrl separately for each build configuration in the project file?

At the moment I'm having to set these manually in the Publish options, but it could be easy for someone to forget to do this and end up publishing a Test version of our application to our Training environment or vice versa.

I know that I also have to change the Application Identity using MageUI in order to run multiple versions of the ClickOnce application on the same PC, but it would be nice to at least not have to worry about the ProductName and PublishUrl properties being correct every time we need to do a deployment (although it would be ideal if we could access the Application Identity from within the IDE too!).

like image 286
TabbyCool Avatar asked Dec 07 '09 14:12

TabbyCool


1 Answers

It turns out that you can set the PublishUrl and ProductName in the .csproj file for each configuration setting, but you need to close and reopen the solution file before the project properties are refreshed, merely unloading and reloading the project or building it under a different configuration isn't enough to refresh this, it would seem.

My csproj file now has the following settings for each configuration...

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Test|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <ErrorReport>prompt</ErrorReport>
    <AppConfig>app.Test.config</AppConfig>
    <PublishUrl>http://MyServer/Synergi/Test/</PublishUrl>
    <ProductName>Synergi Test</ProductName>
</PropertyGroup>
like image 94
TabbyCool Avatar answered Nov 15 '22 08:11

TabbyCool