0

I am able to modify database conection and mailsetting web.config from web setup project; however can't figure out how to modify a custom section:

<configuration>
<projectConfig siteName="name" supportEmail="" adminEmail="" thumbnailSize="120" />
</configuration>

I get these values from a cutom action in my setup project. Thanks in advance.

hncl
  • 2,295
  • 7
  • 63
  • 129
  • 1
    Possible duplicate of http://stackoverflow.com/questions/270287/editing-web-config-programatically – walther Apr 15 '12 at 06:09
  • I can't help but think you are looking for the xml transforms. (google this xdt:Transform="SetAttributes") This gets set as per your environment on deploy. If that's not what you are wanting to do that config is easily (and more appropriately) stored in a database. – Peter Apr 16 '12 at 05:14
  • I am trying to change the web.config from a custom aciton using c# for example: appDatabase1.Name = "MainDBContext"; appDatabase1.ConnectionString = applicationConnectionString; I can find the coonnectionstring section, but have no idea how to find a configuration section that I have added to web.config mannually. – hncl Apr 16 '12 at 05:22

1 Answers1

0

I think you are looking for something like this: http://foreachbiscuit.wordpress.com/2007/10/11/custom-webconfig-settings/

JoJa
  • 612
  • 5
  • 8