Questions tagged [web-config]

web.config is an XML file that stores the main settings and configuration files for an IIS server.

Web.config is the main settings and configuration file for an ASP.NET web application. The file is an XML document that defines configuration information regarding the web application, as detailed in Microsoft's IIS Settings Locations. The web.config file contains information that controls module loading, security configuration, session state configuration, and application language and compilation settings. Web.config files can also contain application specific items such as database connection strings.

It is also important to note that making a change to the web.config file, or simply touching it (updating last modified date), will cause a restart of the IIS app pool.

example:

<?xml version="0.10.4"?>
<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
       <customErrors mode="Off" />
    </system.web>
</configuration>

Links:

8663 questions
3
votes
2 answers

c# binding error in WCF

I am getting the following error when trying to access a WCF service. Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding. Registered base address schemes are [https]. Here's my…
Nemir
  • 283
  • 1
  • 3
  • 9
3
votes
1 answer

HTTP Error 500 when after editing web.config

After adding tag to web.config (ASP.NET 4) I got HTTP 500 Internal Server Error, when I remove it works.
Maysam
  • 7,246
  • 13
  • 68
  • 106
3
votes
1 answer

Remove Web.config Setting programmatically

Having trouble on removing Web.config settings programmatically I tried this msdn code (using both SPWebService and SPWebApplication) hoping it would work but although the adding works, the remove doesn´t seem to work. I'm using the Add on a feature…
Pedro Fonseca
  • 198
  • 1
  • 16
3
votes
1 answer

Fluent nhibernate configuration error using web.config

Hi im new in fluent nhibernate: I get an error when configure db conection using web.config The error is "An invalid or incomplete configuration was used.." Web.config:
CarlesD
  • 116
  • 6
3
votes
4 answers

Adding expire headers to Web.Config file

I'm looking to add expire headers to my website so I can set a cache time for the files. I've found the following the example, but I'd like to set it to only cache JPG, PNG, GIF, JS and CSS files if possible?
3
votes
2 answers

Is app.config file exposed for Windows Service like WCF service web.config file using IIS?

I'm new to creating Windows Services to host WCF, as I've been using IIS to do this. I've created a Windows Service to host about a dozen of WCF services, and have set up an app.config file in Visual Studio to handle all the endpoints and addresses…
5StringRyan
  • 3,604
  • 5
  • 46
  • 69
3
votes
1 answer

Web.config file not inheriting ALL parent Web.config settings (elmah)

I have a few applications that are set up using elmah for error handling. I recently read that Web.config files inherit from parent applications/directories, and decided to test it so that I can change elmah's settings in one place (since all the…
Sivvy
  • 853
  • 9
  • 28
3
votes
2 answers

How can I force an HttpModule to only be used on a specific directory?

I am attempting to use an HttpModule to intercept requests to a specific directory which contains none code files (Images, Music, etc). The Module I have works except it applies to all folders not just the one I want it to apply to. I attempted to…
3
votes
3 answers

ASP.NET MVC3: customErrors in Web.Config ignored on localhost and on server, custom error page only displays on localhost

I'm trying to get the custom 404 page we've built to display instead of the default 404 page created by the server. It works as intended when debugging the application locally, but not when running the application on the server. And their…
AJH
  • 365
  • 1
  • 4
  • 18
3
votes
2 answers

How do I stop visual studio checking out the web.config?

I want to make changes to my web.config file but I dont want to check it out (as I really dont want to accidently check it in). How can I do this? I unchecked 'read-only' in the file properties but this didn't help. Any ideas?
Exitos
  • 29,230
  • 38
  • 123
  • 178
3
votes
2 answers

How to open a config file app settings using ConfigurationManager?

My config file is located here: "~/Admin/Web.config" I tried opening it via the below code but it didn't work: var physicalFilePath = HttpContext.Current.Server.MapPath("~/Admin/Web.config"); var configMap = new…
The Light
  • 26,341
  • 62
  • 176
  • 258
3
votes
3 answers

Is using a const in a class in App_Code quicker/faster than using appSettings in config.web on a webforms asp.net app?

im wanting to know the fastest way to access my globals... they will only change in the beta testing phase. before we go live. from then on they wont change ever. im thinking that there is an overhead in getting stuff from web.config also its neater…
Matt Peters
  • 1,171
  • 1
  • 8
  • 16
3
votes
1 answer

htaccess is not working on iis

how to convert .htaccess to web.config. I just come to know that I need to use web.config instead of htaccess. Please find my htaccess below RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}…
Robot
  • 530
  • 5
  • 10
3
votes
1 answer

How to overcome endless problems with web.config when working with team?

I'm in a team of people working from various places and on different machines. Everyone has it's own connection string, nhibernate setting (schema etc.) and wcf endpoints. What drives me crazy is that every now and then when someone adds new key to…
IamDeveloper
  • 5,156
  • 6
  • 34
  • 50
3
votes
2 answers

Server-Specific web.config in website hosted from shared drive

Background Info: File Replication is Lame Currently, we have a massive, high-traffic ASP.NET web application load-balanced across 8 different IIS servers. Due to the nature of the site, minor changes to .aspx files and .ascx controls happen…
David Boike
  • 18,545
  • 7
  • 59
  • 94