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
108
votes
2 answers

Web Config Transformation to add a child element

I've got the following configuration in web.config:
Ben Foster
  • 34,340
  • 40
  • 176
  • 285
107
votes
6 answers

How to read appSettings section in the web.config file?

My XML looks like this and the filename is web.config
realn
  • 1,732
  • 3
  • 12
  • 20
107
votes
22 answers

No assembly found containing an OwinStartupAttribute Error

This error The following errors occurred while attempting to load the app. - No assembly found containing an OwinStartupAttribute. - The given type or method 'false' was not found. Try specifying the Assembly. To disable OWIN startup discovery, add…
NVA
  • 1,662
  • 5
  • 17
  • 24
105
votes
9 answers

Authentication issue when debugging in VS2013 - iis express

I'm trying to pick up the windows username when debugging in Visual Studio 2013. I am simply using: httpcontext.current.user.identity.name If I run this on my Dev Server it works fine, if I run it in debug mode on any previous version of Visual…
104
votes
6 answers

Read Variable from Web.Config

How can I add and read the value from web.config file?
Amira Elsayed Ismail
  • 9,216
  • 30
  • 92
  • 175
103
votes
10 answers

Web Config Transform not working

In a .NET MVC 3.0 Application I have the following configuration in appSettings: web.config
HaBo
  • 13,999
  • 36
  • 114
  • 206
101
votes
15 answers

Setting up connection string in ASP.NET to SQL SERVER

I'm trying to set up a connecting string in my web.config file (Visual Studio 2008/ASP.NET 3.5) to a local server (SQL server 2008). In my web.config, how and where do I place the connection string? Here's what web.config file looks like right now:…
Ray
  • 3,409
  • 8
  • 33
  • 40
98
votes
15 answers

Variables within app.config/web.config

Is it is possible to do something like the following in the app.config or web.config files?
DeeStackOverflow
  • 2,741
  • 4
  • 23
  • 23
98
votes
9 answers

Developer specific app.config/web.config files in Visual Studio

We have several .NET projects where we store certain settings in configuration files. Now each developer will have their own configuration files that differ a little (different connection strings to connect to local databases, different WCF…
twarz01
  • 981
  • 1
  • 7
  • 3
98
votes
4 answers

Change a web.config programmatically with C# (.NET)

How can I modify / manipulate the web.config programmatically with C# ? Can I use a configuration object, and, if yes, how can I load the web.config into a configuration object ? I would like to have a full example changing the connection string.…
Kottan
  • 4,944
  • 9
  • 41
  • 67
97
votes
5 answers

Escape quote in web.config connection string

I have a connection string in my web config: As you see, there is a quotation sign ( " ) in the password (given…
Sebastian P.R. Gingter
  • 5,955
  • 3
  • 31
  • 73
96
votes
7 answers

ASP.Net Web Application Add Config Transform Grayed Out

I added an existing ASP.Net web application project to my solution. In addition to the standard debug and release configurations this solution also has two custom configurations, SAT and UAT. For the new web application right clicking on Web.Config…
paulv7260
  • 993
  • 1
  • 7
  • 7
95
votes
2 answers

ReplacableToken_ when using web.config transform?

I have a web.config with 2 transforms - for debug and release. web.config:
sirrocco
  • 7,975
  • 4
  • 59
  • 81
94
votes
4 answers

What does the Web.Config file do in the views folder of a MVC project

I'm having some problems with deploying my application and while troubleshooting, I came across the Web.Config file in the Views folder. In an attempt to narrow down the possibilities of sources to my problem, I tried to find out the purpose of that…
Ola Karlsson
  • 9,011
  • 7
  • 27
  • 37
91
votes
4 answers

Web.Config Debug/Release

I know that web.config in Visual Studio 2010 provides the ability to switch from databases from Debug mode to Release mode. Here is my Web.Release.config: