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
168
votes
21 answers

ASP.NET: HTTP Error 500.19 – Internal Server Error 0x8007000d

I am replicating web application deployment and found several issues related to HTTP Error 500.19. My machine is running Windows 7 while the working development is using Windows 8. We're developing our Web Application using Visual Studio…
David
  • 3,957
  • 2
  • 28
  • 52
166
votes
5 answers

Use Visual Studio web.config transform for debugging

Possible Duplicate: How can I use Web.debug.config in the built-in visual studio debugger server? I want to use the Web.config transformation that works fine for publish also for debugging. When I publish a web app, Visual Studio automatically…
Cutter
  • 1,661
  • 2
  • 11
  • 3
166
votes
6 answers

[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to... web.config issue

I am getting the following error: [A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, …
Maxim
  • 3,836
  • 6
  • 42
  • 64
166
votes
10 answers

How to configure the web.config to allow requests of any length

I am building a site in which i would like to create a file client side from the value of a textarea element. I have the code in place to do this, but i am getting this error HTTP Error 404.15 - Not Found The request filtering module is …
some_bloody_fool
  • 4,605
  • 14
  • 37
  • 46
162
votes
7 answers

Forms authentication timeout vs sessionState timeout

I have code that i am looking through regarding session time outs of the website. In the web.config i came across this code.
Lucky Luke2
  • 2,056
  • 5
  • 25
  • 32
157
votes
24 answers

Web Application Problems (web.config errors) HTTP 500.19 with IIS7.5 and ASP.NET v2

This is driving the whole team crazy. There must be some simple mis-configured part of IIS or our Web Server, but every time we try to run out ASP.NET Web Application on IIS 7.5 we get the following error... Here's the error in full: HTTP Error…
Chuck Le Butt
  • 47,570
  • 62
  • 203
  • 289
149
votes
3 answers

How to configure static content cache per folder and extension in IIS7?

I would like to set up rules in IIS7 for static content caching in my ASP.NET website. I have seen these articles, which details how to do it using the element in web.config: Client Cache (IIS.NET) Add Expires or Cache…
frankadelic
  • 20,543
  • 37
  • 111
  • 164
147
votes
1 answer

Meaning

I wanted to know what is the meaning of I am using IIS 7.5 and I have a simple web application. Do I need to write this in my web.config file. I have also written few http handler for jquery…
शेखर
  • 17,412
  • 13
  • 61
  • 117
137
votes
2 answers

Which gets priority, maxRequestLength or maxAllowedContentLength?

While changing the maximum allowed file size for upload I stumbled on those two settings. In the sytem.web you have the http runtime node with maxRequestLength. In the system.webServer you have the requestLimits with maxAllowedContentLength. Now…
Floris Devriendt
  • 2,044
  • 4
  • 24
  • 34
131
votes
8 answers

How to set the Default Page in ASP.NET?

Is there any section or code which allows us to set default page in web.config? For example, when people first visit my website, I want them to see CreateThing.aspx rather than Default.aspx. The solutions I already know: Put this line of code =>…
Tarik
  • 79,711
  • 83
  • 236
  • 349
128
votes
6 answers

"An exception occurred while processing your request. Additionally, another exception occurred while executing the custom error page..."

I'm trying to publish an MVC website as an Azure webrole. When I run it locally, everything works fine. But once I publish it to Azure and surf to some MVC action, I get this error: Server Error in '/' Application. Runtime Error Description: An…
Ilya Kogan
  • 21,995
  • 15
  • 85
  • 141
127
votes
12 answers

Access-control-allow-origin with multiple domains

In my web.config I would like to specify more than one domain for the access-control-allow-origin directive. I don't want to use *. I've tried this syntax:
Sam
  • 13,934
  • 26
  • 108
  • 194
118
votes
20 answers

The name 'ViewBag' does not exist in the current context - Visual Studio 2015

I'm starting to develop in ASP.NET again and I ran into a small error within Visual Studio. My .cshtml files show errors when using a few razor functions. For example "The name 'ViewBag' does not exist in the current context". Here is a picture: I…
Michjuh
  • 1,182
  • 2
  • 8
  • 10
116
votes
4 answers

What are the Web.Debug.config and Web.Release.Config files for?

I just upgraded to Visual Studio 2010 and MVC 2.0 and I noticed the Web.config has two additional files attached to it? Are these files used to specify debug and release specific settings, so you don't clutter up the main Web.config? Does it even…
chobo
  • 31,561
  • 38
  • 123
  • 191
115
votes
7 answers

Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive

I just installed vs 2010, followed by IIS in window 7. when building a website in .net framework 4.0 and convert this into application in IIS then its shows this error If i remove the targetFramework="4.0" from web config file then it shows me a…
rahularyansharma
  • 11,156
  • 18
  • 79
  • 135