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
1 answer

specify masterpage of subdirectory pages in web.config

I know its possible to specify the masterpage of all pages using the pages element of the web.config but is it possible to specify that for all the pages under /foo/ that they should have a certain master page, and specify this in the root…
Daniel Powell
  • 8,143
  • 11
  • 61
  • 108
3
votes
1 answer

Reading attributes in ConfigurationSectionGroup

Consider the following configuration group in a .NET .config file. The supporting classes are: public class MySettingsConfigurationSection…
JCallico
  • 1,446
  • 18
  • 25
3
votes
1 answer

Can I Redirect to HTTPS from HTTP if port 80 is closed

I have a react web application that I'm hosting on a Windows Server. In IIS I created URL Rewrite rules. When I view the website from within our network the rewrite rules work and it redirects from HTTP to HTTPS. However since port 80 is closed on…
JImmy G
  • 149
  • 3
  • 12
3
votes
0 answers

HTTP to HTTPS Redirect not working on mobile - IIS

I'm trying to set rules on IIS to redirect to HTTPS if the user enters the site through HTTP. Right now my current code redirects to HTTPS if the user browses the site via desktop computer. However when accessing my website via HTTP on any mobile…
hisusu32
  • 437
  • 7
  • 22
3
votes
3 answers

CSS not loading for Forms Authentication

I have seen several of these topics on numerous sites and I am still having an issue. I have added this to the bottom of my web.config right before the
Matt
  • 1,220
  • 3
  • 21
  • 36
3
votes
3 answers

Adding a custom hashAlgorithmType in C# ASP.NET

I've got a page that I need to beef up security on. I'm using the built-in MembershipProvider functionality and currently have hashAlgorithmType set to SHA512. I've got the BCrypt.NET library (http://bcrypt.codeplex.com/) and it seems to be working…
David Perry
  • 1,324
  • 5
  • 14
  • 31
3
votes
2 answers

SMTP Appender - log4net issue

I am having issues getting my SMTP appender working: I have the follow config file setting:
mp3duck
  • 2,633
  • 7
  • 26
  • 40
3
votes
2 answers

How to replicate rewrite rule in .net core startup from web.config, API calls returning index.html

I have following Web.Config, which works fine for IIS. However its not working for self hosted like in Windows Service.
TBA
  • 1,077
  • 5
  • 41
  • 80
3
votes
1 answer

How to add no-cache header for IIS when request is localhost/site root

I have a website hosted in IIS 10 The .js and .css files are versioned using this pattern ?v=a.b.c (where a.b.c is changed with a new number every time is required) in order to invalidate the cache browser. This is how the site starts : user enters…
Lucian
  • 344
  • 1
  • 6
  • 19
3
votes
1 answer

How to transform this portion of webconfig in my web.config.release?

I need to change SMTP host value on web.config transform. Here is what I have:
katit
  • 17,375
  • 35
  • 128
  • 256
3
votes
3 answers

ASP.NET Chart: What's wrong with my web.config. I can't display a chart

I just created a web page having a barebone chart with a few data points to test. On localhost, the chart is displayed as expected with no problem. But when I deployed to my webhost I got a 500 - Internal Server Error 500 - Internal server…
user776676
  • 4,265
  • 13
  • 58
  • 77
3
votes
2 answers

Need to preserve HTTP status code when using httpErrors custom 404 error using responseMode executeURL on Azure App Service IIS

I want to have all missing content/"bad" URLs redirect to our custom 404.html error page. This is important for accurately recording 404 errors in Google Analytics. The issue is that when the responseMode=ExecuteURL flag is set, then the custom…
3
votes
2 answers

How do I get rid of Unit Testing relicts in my Web.config?

While uploading my current project to our staging server I noticed that the Web.config file of my Asp.net MVC framework contains some references to assemblies…
winsmith
  • 20,791
  • 9
  • 39
  • 49
3
votes
0 answers

The configuration section 'security' cannot be read because it is missing a section declaration

I am trying to add to the web.config the following section:
Hidalgo
  • 941
  • 2
  • 14
  • 38
3
votes
2 answers

ASP.Net custom errors on specific hosts

Is there a way to display custom errors on specific host(s) (eg: www.example.com) and display vanilla errors on others (eg: beta.example.com)? I'm thinking along the lines of configuration syntax that can be added to the customErrors section of the…
grenade
  • 31,451
  • 23
  • 97
  • 126