web-config

<machineKey decryptionKey="AutoGenerate"... being ignored by IIS. Won't invalidate previous session's cookies.

(See question below for more context): Are there any situations in which <machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps"/> in web.config would fail to AutoGenerate a new machineKey on App Pool recycle? This is the behavior I'm seeing... I'm using standard ASP.NET FormsAut...

LinqToSql dbml dynamically switch connectionstring

Greetings All, We have two databases, DEV and STAGING. They are for the most part identical. I have an app settings tag in the Web.Config call it "mode", and two connectionstring entries. If mode=DEV I want to use ConnectionString 1 otherwise use ConnectionString 2. This works fine in some parts of the app, but the dbml doesn't seem to ...

ASP.NET Application Error Overriding 404?

I use the Application_Error event to catch and log errors in my app. The Error is logged, then a friendly error screen is displayed: Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) Dim ex As New Exception( _ String.Format("Error on page: '{0}'.", HttpContext.Current.Request.Url), _ Ser...

(ASP.NET) Can you do a String.Format on a web.config key/value?

This might be a god awful question but I'm not sure why it won't let me do this. I have a URL I need to store in Web.config, which has a dynamic parameter pulled from the web page. So I want to store: <add key="TestURL" value="https://test/subscribe?msisdn={0}&amp;code=1&amp;pass=2"/&gt; It doesn't let me do this. After th...

Changing web.config file based on an Environment Variable in ASP.NET

I need to change my connection string in the web.config file based on an environment variable (for different enviornments, like dev/staging/production, etc). I have seen other solutions that use build tasks to accomplish changing different configurations, but haven't been able to find something that will let me change my connection stri...

Loading a different web.config file at runtime fo ASP.NET

I have a web application which I want to use for multiple business areas. I do not want to have multiple instance of the web app code on the web server. So as an example: I have //MyWebSite/Virtual_Directory_1 refers to c:\Inetpub\wwwroot\MyWebApp pointing to Database_A What I want is to setup another Virtual Directory as follows: //My...

Authentication through web.config not authenticating in ASP.net 3.5

Hi, This is one of this things that should be extremely simple and I just can't work out why it's not working. I'm trying to set up some very quick authentication for an ASP.net 3.5 app but storing the usernames and passwords in the web.config file (I know it's not very secure but it's an internal app that I keep getting asked to add a...

Where are Web Application Project Assembly references stored?

Where are assembly refernces stored for a web application? In a Web Site, I see assembly tags written to the assembly node in the web.config when you add a reference. I am just curious as to how the Web Application Project makes the connection to get the correct local dll? I manually add the reference and the application builds, but ...

How do I configure TFS to work with GMail to send TFS Alerts?

Environment: Windows Server 2008, IIS 7.0, TFS 2008 We run Google Apps for email and I'm having a heck of time setting up TFS to send alerts to our Google hosted mail. I googled around and found a couple of workarounds however none have worked for me. Any pointers graciously accepted. ...

Global.asax Application_Error doesn't work with Integrated Mode

Application_Error doesn't work with Integrated Mode but does work with Class Mode. I would to transfer request to error page using both Integrated Mode and Class Mode. Can this be done or I have to use HTTP module in order to support both modes? protected void Application_Error(object sender, EventArgs e) { if (Context != null && Co...

Merging/inheriting web.config files but without having site to be a child site

I'd like to have the functionality of merging/inheriting the web.config of one site with that of a shared web.config, but without having the site being a child site of the site with the shared web.config. Is there a way to implement similar functionality? What I'm trying to do have a shared web.config in any folder (could be outside of...

Is encrypting web.config pointless?

I was reading a blog today (http://somewebguy.wordpress.com/2009/07/20/is-encrypting-your-web-config-a-waste-of-time/) about both how to encrypt your appsettings/connectionstrings etc. using the aspnet_regiis tool. He has a follow up post with some feedback from others saying this is a waste of time. My question is, what do you think?...

Is this the only reason for using custom section types ( derived from ConfigurationSection )?

Hello, I've just started learning about extending the Configuration file structure by creating custom section types ( using ConfigurationSection class ), but I'm not sure I understand its usefulness. BTW – this is not a »custom section type vs appSettings« question. I already understand the benefits of using custom section types over...

Custom ASP.NET Configuration Section

Hi All I want to create a custom configuration section to handle email notifications. The configuration needs to be in the following format: <configSections> <sectionGroup name="notifications"> <section name="notification" type="NotificationConfiguration" allowLocation="true" allowDefinition="Everywhere" /> </sectionGro...

web.config auto caching

I have custom configuration section within web.config file. I'm lingering between: Reading it into static class every time when I need any configuration value (because I guess that system already caches files when I open them (for instance when I run Word it takes longer the first time and much less on consecutive opens)) Reading it in...

Asp.net MVC error with configured managed modules

I have a custom authentication HttpModule that is pretty strait forward. But I want it to run only for managed requests (and not for static ones). Asp.net MVC automatically adds configuration section for IIS7 web server: <system.webServer> <validation validateIntegratedModeConfiguration="false" /> <modules runAllManagedModulesFor...

ASP.net, dlls and webconfigs

We have an ASP.Net solution that is split up in to several projects (some are class libraries and some are actual Asp.Net sites). One thing that has always bothered me is if the ASP.Net sites and class library dlls are built in debug mode, and are then published, web config changed so that "debug=false" will the class library dlls be bu...

Prevent MS Web Development Server (Cassini) from running HttpModules for static content requests

IIS7 supports this by using <system.webServer> configuration element to set module's preCondition="managedHandler" attribute. Since Cassini is a managed server it serves requests in a similar way as IIS7 does. All requests are handled by managed code. By similar I mean it executes HttpModules for every single request even if it's static...

Is .Net reading web.config from top to bottom?

1) If ( inside web.config file ) I declare custom section named songPoem before <configSection> , an error is reported saying songPoem element is not recognized. Thus, the following gives me an error: <songPoem song=”lalala” /> <configSection> <section name=”songPoem” type=”A” /> </configSection> while the following works just fin...

UltiDev Cassini and <system.webServer> web.config settings

MS Cassini Development Web Server is a nice product that executes web requests in a similar way that IIS7 does. Every request (event for static content) goes through the same .Net pipeline without exception. All custom HttpModule can handle any request. But sometimes you don't want these modules to execute for certain content (most ofte...