I have a development app.config and a deployment app.config. I need clickonce to change it on deployment.Is this posible to be done automatically?
I have a development app.config and a deployment app.config. I need clickonce to change
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
An easy way would be to copy the app.config file in the pre-build script that you can define in the app’s property page Build events.
You could do either:
1) Create a solution config used only for deploying to production, and switch on that in the script, e.g.
or, if you only build the publish config on a specific machine:
2) Always run the script in the pre-build event:
and the CheckAndReplaceAppConfig.cmd would in this case have: