Let us consider a web.config file deployed from website….
let us take another project say console application or some class file then is it possible to read that web.configuration file and add some tags in that web.config file
i just want to add these lines in to it
<system.webServer>
<modules>
<add name="sample" type="sample.class" />
</modules>
</system.webServer>
Waiting for your valuable comments
Updated: Read this Article and download source code, it may help you to read/write new section in config files.
To read the
AppSettingsfrom theWeb.Configfile you can use the ConfigurationSettings or ConfigurationManager Class.It works like the following
ConnectionInfo is in the Web.config file under the AppSettings like
and to write in the web.config AppSettings section.. Let’s say you have a key ‘SiteName’ in your appsettings section of your config file… you can update it like that..