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

Why encrypt with aspnet_regiis.exe

I want to encrypt my web.config file to hide some sensitive data like passwords with aspnet_regiis. Encryption is made with this code in the command prompt C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis.exe -pef "appSettings"…
PEPEGA
  • 2,214
  • 20
  • 37
3
votes
4 answers

Configure my connection string in the Azure application setting and configure it in my web.config as an environment variable

I have a Web App in Azure and I configured the connectionStrgin in its application setting, but I do not know how I can set this configuration as an environment variable in the application web.config (.Net). Someone has some document or knows how to…
3
votes
0 answers

How to use both Custom and Detailed Error Modes under IIS7, IIS7.5

The Condition I have created my own web framework, which intercepts Error 404 and displays the appropriate content depending on the URL (it also sends the correct HTTP code 200 or 404 when the URL is valid or not). I have the entire framework under…
Jack Watts
  • 57
  • 7
3
votes
1 answer

Disable "httpErrors" element for a specific path

I'm having trouble with httpErrors element in Web.config. I decided to use httpErrors element to handle http errors and show custom error pages in my (ASP.NET MVC) application. The problem is that I also have an API that I don't want httpErrors…
Arad Alvand
  • 8,607
  • 10
  • 51
  • 71
3
votes
0 answers

Keep the tag when encrypting a web.config file

I'm using aspnet_regiis.exe to encrypt connectionStrings in a web.config file for a WCF Restfull service using the following command aspnet_regiis.exe -pef connectionStrings C:/pathToWebConfig The service is hosted as an application under a…
3
votes
2 answers

How to deploy react.js project on iis server at subdomain?

I would like to deploy react.js project on iis server at a subdomain. The works I do below: BrowserRouter with basename import { BrowserRouter } from 'react-router-dom'; In…
3
votes
3 answers

How sent e-mail from ASP.NET site using GMail's SMTP server?

Possible Duplicate: Sending email through Gmail SMTP server with C# I would like my ASP.NET MVC application to send some standard letters to users of the web site. For testing purposes I have no local SMTP server and my provider has non that I…
Rasto
  • 17,204
  • 47
  • 154
  • 245
3
votes
1 answer

asp.net webforms handle 404 notfound error in codebehind?

Just trying to detect if it's 404 error in application. For example user tries in url and IIS shows 404 not found. I want to detect 404 error. Redirect to custom 404 page and pass message like "cound't find" dynamically from the codebehind. Has…
Mert
  • 99
  • 12
3
votes
2 answers

Multiple level web.config transform

Is there any way to apply a web.config transform on more than one level? E.g: web.config - web.release.config - web.prod1.config - web.prod2.config When targeting prod1, I would like to do a 3 way merge web.config < web.release.config <…
filur
  • 2,116
  • 6
  • 24
  • 47
3
votes
2 answers

Understanding ASP.NET Web.config transformations - Web.Debug.config

I've been strugling with this for one hour and can't find to simple explanation or at least some Microsoft documentation that states this. I want to understand behaviour of next…
broadband
  • 3,266
  • 6
  • 43
  • 73
3
votes
1 answer

What is the alternate of web.config file in asp.net core

I am started working on asp.net core web application and there is no web.config file in this project. Here is appsettings.json file though. I don't know where to store confidential information (like we store username and passwords of domain in…
3
votes
1 answer

Registering a Custom ASP.NET ExpressionBuilder Programmatically

Is it possible to register a custom ExpressionBuilder class programmatically during application startup? The equivalent web.config declaration is obviously:
qJake
  • 16,821
  • 17
  • 83
  • 135
3
votes
1 answer

Rewrite rule to redirect URL

I am creating URL as - http://localhost:13490/level1/XYZ/hulhbgma79 trying to redirect this url on - http://localhost:13490/level1/PQR/HttpHandler.ashx?Id=hulhbgma79 In above given example of URL level1 - this name is changing according to…
3
votes
2 answers

Under what conditions would we use the before each in a web.config

I have been looking in the web.config at some legacy code, where under most of the group sections before each a was added, for example:
r.net
  • 601
  • 7
  • 16
3
votes
1 answer

Deny access to .axd in IIS 7.0 based on IP address

I want to be able to deny access to all but a defined set of IP addresses for a particular .axd in IIS. At the moment, I'm doing this in the code for the axd (it's a managed handler written in C#) Is there a way I can do this through configuration…
Kram
  • 4,099
  • 4
  • 39
  • 60
1 2 3
99
100