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

Disable HTTP Access via web.config

I want my users access a specific asp.net virtual directory only via SSL. Is there an option in web.config that allows me to specify this?
HCL
  • 36,053
  • 27
  • 163
  • 213
3
votes
1 answer

Style guide / optimal way to layout web.config & app.config for ongoing support

Config files have grown so complex that some have suggested that they are their own programming language. If I were to take this analogy further, it would make sense to have some consistencies when editing the file. I was going to limit this…
makerofthings7
  • 60,103
  • 53
  • 215
  • 448
3
votes
1 answer

asp.net Authorization: location and IPrincipal.IsInRole

Scenario I'm using a Custom IPrincipal and IIdentity to do asp.net authorization. I set the Principal and Identity during the PostAuthenticateRequest event using an IHttpModule. The web.config looks approximately like the following:
brad
  • 73,826
  • 21
  • 73
  • 85
3
votes
2 answers

Configuration Builders - Unable to load assembly - .Net Framework

I am using file based User Secrets within my .Net Framework WebAPI and all is working fine with the AppSettings section of the web.config as per below
Chris Hammond
  • 2,064
  • 5
  • 27
  • 53
3
votes
1 answer

.Net Core 2.2 web.config won't transform LAUNCHER_PATH or LAUNCHER_ARGS on publish in Azure DevOps

I have a simple API project that I can push to Elastic Beanstalk and run on IIS without trouble. The Web.Config (pretty standard), look like this:
Mr Shoubs
  • 14,629
  • 17
  • 68
  • 107
3
votes
3 answers

Rewriting a Url which can contain 1 or 2 querystrings with URLRewriter.NET?

In my project, my /PropertDetail.aspx can get 2 querystrings. 1st one for the PropertyId /PropertDetail.aspx?PropertyId=5 2nd one for the Language /PropertDetail.aspx?PropertyId=5&Language=2 EDIT: and this page can get one of them or can get both…
Barbaros Alp
  • 6,405
  • 8
  • 47
  • 61
3
votes
1 answer

configSource absolute path work-around

I have a WCF data service with some methods I call asynchronously during page_load events. I need a solution to call these methods from either a script or console app if necessary. I created a console app that references the WCF .dll libraries. I…
Sean Thoman
  • 7,429
  • 6
  • 56
  • 103
3
votes
1 answer

Web.Config - StaticContent ClientCache setup for specific files

I want to be able to apply caching to Static files on my site. I want the caching to apply to specific file extensions only but I'm not 100% certain of the syntax to add to my web.config file. This is what I have so far:
scgough
  • 5,099
  • 3
  • 30
  • 48
3
votes
3 answers

Use new ChannelFactory(string) if the config is in a string?

I would like to use the ChannelFactory to create a WCF Client for a given endpoint. The problem is that I don't have a web.config or app.config, but I do have the whole XML block in a string. I do not want to manually parse…
Michael Stum
  • 177,530
  • 117
  • 400
  • 535
3
votes
1 answer

encrypting web.config data for multiple servers

I need to encrypt sections of my web.config file for a client. Most of the references I've seen are to using aspnet_regiis to do the encryption. However, as far as I can see, this needs to happen on the web server which will host the site, which…
joelt
  • 2,672
  • 2
  • 24
  • 32
3
votes
3 answers

How do I get Web.xml context-param values in controller action method?

This feels like a basic question, but I haven't had much luck Googling. My app connects to an SMTP server and sends mail through it. I need this SMTP server to be configurable based on which environment the app is deployed to. How can I specify the…
kmehta
  • 2,457
  • 6
  • 31
  • 37
3
votes
2 answers

IIS Express No AppSettings

I am running a .NET 4.0 Web Application. Under IIS Express ( and only IIS Express ) none of my APPSettings are read into the AppSettings collection. When I look into this collection it is empty even though I have about 15 app settings in the…
Joshua Hudson
  • 2,187
  • 2
  • 20
  • 24
3
votes
1 answer
3
votes
3 answers

Different configuration files for development and production in ASP.NET application

On a project I'm working on we have a web application with three configuration files; Web.Config Web.Config.TestServer Web.Config.LiveServer When we release to the test server, Web.Config is renamed to Web.Config.Development and…
Aligma
  • 562
  • 5
  • 29
3
votes
2 answers

ASP.net why is application settings string only?

Why do I have to set everything as a string? Why can't I have different datatypes in there like int to help…
Tom Gullen
  • 61,249
  • 84
  • 283
  • 456
1 2 3
99
100