.NET Framework Developer Center > .NET Development Forums > Windows Communication Foundation > Modifying the web.config during the installation of a Web Setup Project
Ask a questionAsk a question
 

AnswerModifying the web.config during the installation of a Web Setup Project

  • Tuesday, November 03, 2009 8:27 PMVicB.Net Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    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

All Replies