Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Multiple Publish Targets for ClickOnce
 

Multiple Publish Targets for ClickOnce

I have inherited a project that uses clickonce deployment. It has a number of configuration settings specific to the environment such as web service url, database connection strings etc. I have four environments that i need to deploy the application to.

It seems that i have to update the project with these configuration settings, then publish, for each environment and i have four environment specific deployments. This is becoming difficult and time consuming to manage. Is there a mechanism that allows me to manage the situation. Is is possible to have a single deployment that uses a set of environment specific setting located in each environment.

How do others manage this situation?

regards

Paul
Paul Durdin  Thursday, October 01, 2009 6:59 AM

Do a bing search on "mage", the manifest generator. I think you can create scripts and use this to modify and generate each of your deployments.

The mage.exe (and mageui.exe, which has a UI component) are in the C:\Program Files\Microsoft SDKs\Windows\v6.0a\bin\ folder.

RobinDotNet


Click here to visit my ClickOnce blog!
RobinDotNet  Thursday, October 01, 2009 7:55 AM
Hi Paul,

Based on my understanding, these four environments have different web service URL settings, database connection settings etc. But you don’t want your user to make these configurations after install the app. You want to pre-set them. Am I misunderstanding you?

If my understanding is correct. I think you will have at least four URLs to hold these deployments. My suggestion is you can make four copies of your solution; set the configuration information in the VS for each of them and publish. That will be easier than use mage.exe to manually deployment your ClickOnce application. Therefore different business purpose users can install the application from different URLs. They don’t need to configure any more.

If I misunderstood you, please feel free to tell me.

Sincerely,
Kira Qian
Send us any feedback you have about the help from MSFT at EMAIL REMOVED
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework!
Kira Qian  Friday, October 02, 2009 8:43 AM

Doh! I missed the note about the different settings. I thought he just wanted to deploy it from four different places. Kira is right, it will be easier to use Visual Studio than Mage.

RobinDotNet


Click here to visit my ClickOnce blog!
Microsoft MVP, Client App Dev
RobinDotNet  Friday, October 02, 2009 9:36 AM
Hi

I would be a happy if i could store the settings somewhere on each platform. The issue is that the settings are in the solution / project files which means that i keep having to change the settings, publish, then repeat for each environment - time consumming. Ideally i would like the settings to be on the application server where the application is launched from, but the original developer tells me that this can't be done. It would be nice to have a single deployment package that i can install on each target platform.

Paul
Paul Durdin  Friday, October 02, 2009 10:04 AM
You mentioned the connection string and web service urls. Are these in a configuration file, or can you put them in a configuration file and just include a different file with each deployment? Exactly what settings are different for each deployment? By target, do you mean .NET version or CPU or what?

RobinDotNet
Click here to visit my ClickOnce blog!
Microsoft MVP, Client App Dev
RobinDotNet  Friday, October 02, 2009 7:08 PM
Hi Paul,

As you have already known, ClickOnce doesn’t support to keep some configuration files on the server and let users to download them along with the ClickOnce app.

Another thought is you can put all these settings information in a single configuration file. So you just need to publish one copy. When your users want to use the application, let them choose which environment to connect. Their choices can be stored in the configuration file too. That is a better solution once you have many environments. But you need to redesign some parts of your application.

Hope this information helpful to you.

Sincerely,
Kira Qian
Send us any feedback you have about the help from MSFT at EMAIL REMOVED
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework!
Kira Qian  Tuesday, October 06, 2009 8:50 AM

You can use google to search for other answers

Custom Search

More Threads

• Accessing the published version
• Strategy for install when Windows XP SP2 not installed
• Query-strings in ClickOnce
• Deployment Project (Setup): Problem with Registry Entry
• signing exe, dll in xaml application
• Software Updates
• ClickOnce with Project Dependencies
• From where does the clickonce installer download Crystal Reports XI Release 2?
• Does clickonce work for guest user?
• InstallAllUsers question