Modifying the web.config during the installation of a Web Setup Project
- I have WCF web service project, inside my web.config I have a name value section where I define some values needed for my service.
<section name="complianceModuleSettings" type="System.Configuration.NameValueSectionHandler" /> <complianceModuleSettings> <add key="pyLibRoot" value="somevalue"/> <add key="complianceModuleRoot" value="somevalue" /> </complianceModuleSettings>
My service needs to be installed via a Windows Installer so I have created a Web Setup Project. This works great for installing my service. However I have run into an issue where I want to add a step to the user interface to prompt them to enter a value that I want to use to overwrite this key value pair in my web.config. The reason for this is becuase I don't want to have the person installing the service have to go in after the web service has been installed and modify the web.config by hand.
I have used Set Up Projects before for installing Windows Services and have added new user interface steps and taken those values and passed them to the installer of the windows service intsaller via the custom actions. Is there something similar I can do to take the user entered values and use them to modify the web.config?
Thanks
Victor
System: Visual Studio 2008 Team System sp2- Moved byAmadeo Casas - MSFTModeratorTuesday, November 03, 2009 10:15 PMwrong forum (From:ASMX Web Services and XML Serialization)
- Edited byVicB.Net Tuesday, November 03, 2009 8:30 PMNeed to fix code insert
Answers
Hi Vicb,
For your scenario, I think you will still need to follow the "Custom Action" approach(for vs setup project). Here are some reference on this:
#Modify Connection string in Web.config during installation
http://forums.asp.net/t/1396512.aspx#Walkthrough: Redirecting an Application to Target a Different XML Web Service at Installation
http://msdn.microsoft.com/en-us/library/5k10s063(VS.80).aspx
Also, since this is a pure VS setup issue, I would suggest you post the question in setup forum so as to get more ideas on this:
http://forums.asp.net/17.aspx
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Marked As Answer bySteven Cheng - MSFTMSFT, ModeratorWednesday, November 11, 2009 2:59 AM
All Replies
Hi Vicb,
For your scenario, I think you will still need to follow the "Custom Action" approach(for vs setup project). Here are some reference on this:
#Modify Connection string in Web.config during installation
http://forums.asp.net/t/1396512.aspx#Walkthrough: Redirecting an Application to Target a Different XML Web Service at Installation
http://msdn.microsoft.com/en-us/library/5k10s063(VS.80).aspx
Also, since this is a pure VS setup issue, I would suggest you post the question in setup forum so as to get more ideas on this:
http://forums.asp.net/17.aspx
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Marked As Answer bySteven Cheng - MSFTMSFT, ModeratorWednesday, November 11, 2009 2:59 AM


