i'm deploying my application using ClickOnce.
After deploying it i change a connectionstring manually in app.config in the deployed directory.
But my application seems not to use that changed connectionstring.
When i'm doing just a release build, it works! I can change the string after building an after restarting the application the new string is used.
Can please anyone give me a hint?
Thank you Patrick,
this solution doesn't help.
My problem is not to change the app.config file. My Problem is to get the Application to use the changed Configuration.
I change the app.config using a text editor but my applicaiton does not accept that change.
I'm using clickonce and Windows Forms
I guess it depends, are you having your end-users change the connectionstring, if your end users are changing the connection, you could create a dialog that prompts the user for the connection, Keep the variable in a global static string, save the manifest with the new connectionstring, then when the application restarts, put the connection string from the manifest back into the global string again.
I have a ClickOnce application that requires an sqlconnection that changes per user/site and Once deployed I provide my customers with the IP thats needed for the sqlconnection which is then saved back in the app.config. Hope this helps. Patrick