WIERD: Cant change webconfig in 2.0?

V

VB Programmer

I used to be able to change minor settings in my web.config file when it was
on the web server, such as <appSettings> elements. In ASP.NET 2.0 I noticed
that there is a web.config AND a PrecompiledApp.config file. So, how can I
change <appSettings> (or other) elements once it's been deployed to the
server?

Thanks!
 
V

VB Programmer

This isn't the case. All my other sites work fine and my hoster didn't do
this.

In 2.0 the web.config is handled differently if precomiled it seems. In my
web deployment project I clicked 'enable web.config file section
replacement' and put this: appSettings=appsettings.config;

Then I created an appsettings.config and added the whole <appSettings>
section.

Is this correct? After I publish do I modify the appsettings.config to make
these changes?

Thanks.
 
Joined
Jan 29, 2008
Messages
1
Reaction score
0
Yes, you can do that. Your appsettings.config file should look something similar to this:

<appSettings>
<add key="FileLimit" value="2048" />
<add key="FileTypes" value="pdf,jpg,jpeg,bmp,gif,mpg,mpeg,mp3,wav,avi,fla,psd,doc,swf,txt" />
<add key="Webmaster" value="sali"/>
<add key="ConnectionString" value="server=dev;uid=dev;Pwd=dev;database=dev" />
</appSettings>

You do not need to do anything to your appsettings.config file, in fact you do not even need this file for deployment. This file is only used for replacement. If you look in your deployment folder web.config file you'll see everything within <appSettings></appSettings> was replaced by appsettings.config contents.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top