I'm trying to use Click-once-deploy.
My app.config file has a setting called FileServer - like this:
<
appSettings><add key="FileServer" value="MyPc"/>
</appSettings>
When deployed, I would like it to be...
<appSettings>
<add key="FileServer" value="MyServer"/>
</appSettings>
Is this possible to have one "test" setting and when deployed, have another setting
Thanks,
M O J O

Use one app.config setting - deploy another?
Namialus Dauf
<appSettings>
<add key="LocalFileServer" value="MyPc"/>
<add key="DeployedFileServer" value="MyServer"/>
</appSettings>
and in code
using System.Deployment.Application; // don't forget to add a reference to System.Deployment.dll
using System.Configuration; // don't forget to add a reference to System.Configuration.dll
...
myValue = ConfigurationManager.AppSettings[ApplicationDeployment.IsNetworkDeployed "DeployedFileServer" : "LocalFileServer"]
Daniel Lima
I had used the override feature in 2003 to have a development app.config and a live.config for deployment build.
I could not find it anywhere in 2005, wasted an hour hunting high and low.
I guess a manual edit is required, poor oversite in 2005 tbh.
/edit
Just added the node but it seems to ignore for deployment.
I also notice the ticket on this closed as postponed...
So how do we deploy a production.config with our installers, VS2003 handled this fine, we have lost functionality (and important functionality at that!) in VS2005
Simon
StijnVU
That's a good idea.
In VS2003 there was a property (ConfigurationOverrideFile) that would override the configuration file for a release configuration for deployment purposes. That property still exists, but doesn't seem to work in VS 2005, otherwise it would work perfectly for what you are trying to do.
It would be exteremely helpful if you could log a bug on this in our MSDN Product Feedback center at: http://lab.msdn.microsoft.com/productfeedback/ It will help ensure the proper team sees and responds to the bug. It will have more value coming from an actual customer.
They way to use that is to open the project file and find the <PropertyGroup> element for the configuration you want to override for, usually it's release.
Then add a node
<ConfigurationOverrideFile>MyConfig.config</ConfigurationOverrideFile>
In theory, this should cause any deployment, such as ClickOnce, or a Setup project, that is consuming that Configuration to get MyConfig.config instead of the default app.config. If its working properly, the filename will be MyApplication.EXE.config, and you'll need to look at the source path to verify it's picking up the right file.
Dag Konig
I have filed it as a bug now.
Thanks!
M O J O
lvwrz
Thank you, I'll try to find it once it comes accross into our bug tracking system and see if I can help encourage the team to get it fixed.
Votes on this bug help, (once its validated) for all you lurkers out there! http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx feedbackid=beae3f08-6f3a-48d6-8d62-1bd75844b9b6