开发者

ClickOnce Deployment for different configurations [duplicate]

This question already has answers here: 开发者_开发百科 How do I deploy two ClickOnce versions simultaneously? (9 answers) Closed 9 years ago.

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!).


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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜