web-config

Typed configuration data in a separate config file in ASP.Net 4.0?

I have an asp.net 4.0 web application. I need extensive configuration data for this web application, that is strongly typed and the structure of this configuration data is going to be fairly complex (cannot do with key-value pairs). In the past I remember having done this in .Net 2.0 but cannot figure out how I will do it in .Net 4.0. T...

Procmon notifying "PATH NOT FOUND" for web.config, that too at wrong location in a WCF Service

The environment is windows 2008 R2, X64, .Net 3.5 framework, vmware virtual machine While watching a worker process in ProcMon, I noticed the following error: Date & Time: 10/20/2010 3:21:26 PM Event Class: File System Operation: QueryOpen Result: PATH NOT FOUND Path: D:\Rxxxxxx\Wxx\Pxxx\xxxx.xxxxxx...

Avoid hard-coded roles in MVC?

I understand that in mvc to implement role based security at the controller or action level for my site I could paint the class or method with something like the following: [Authorize(Roles = "DOMAIN\GROUPNAME")] (I use windows authentication) Previously in asp.net I might have done this with a location section in the config. The pr...

Yslow performance improvements in the web.config

Running my site on IIS7 and looking to improve my Yslow rating. Working with asp.net. I am able to cache static resources in the web.config but is it possible to the following also: Set the etag on the resources eg. javascript, images, css files etc Add expires header to the above static resources Set gzipping on components Previously...

Web.config ignoring module

I'm trying to use an http module and corresponding configuration section that I downloaded from http://www.codeproject.com/KB/web-security/WebPageSecurity_v2.aspx. However, my application seems to be ignoring these added items. I set up a test application with the specified configuration and it ran fine. When I tried to add the same...

web.config: Changing an application setting with C#

How can I change an application setting within a web.copnfig programmatically with C# (from another application, which configures the web-application)? The following code snipped doesn't work, because AppSettings[...] is readonly! configuration = WebConfigurationManager.OpenWebConfiguration(...); ConfigurationSectionGroup configuration...

Allow blanket permissions for ASP.NET worker processes from any machine

Hi, Working on an application which has some areas locked down using standard .net authorization through web.config i.e. <location path="MySite/MyPrivateFolder"> <system.web> <authorization> <deny users="?"/> </authorization> </system.web> </location> However I need pages from this location to be accessible by the ASP.NET wor...

How to read web.config APP key settings in HTML markup

I have an ASP.NET site which uses a 3rd party activeX control. I have to pass a few parameters to the OBJECT tag in the HTML page. If i hardcode these parameters into the HTML everything works. I would like to place the parameters in my web.config with app settings "key/value" pairs. My problem is i cannot read the app key setting in ...

How to register HttpHandlers in IIS 7.0 integrated mode using .ashx files

According to documents it's clear how to register HttpHandlers in IIS 7.0 integrated mode if you implement IHttpHandler inside a dll and put it in Bin folder of web application. Then adding a line in web.config of that application completes the registeration process. There is an .ASHX file type which implements IHttpHandler by default. S...

Gzip in web.config not working for me

I am having problems setting up gzip on an IIS7 server via the web.config. The following is the setup <httpCompression minFileSizeForComp="0" doDiskSpaceLimiting="false" staticCompressionDisableCpuUsage="98" staticCompressionEnableCpuUsage="95" dynamicCompressionEnableCpuUsage="30" dynamicCompressionDisableCpuUsage="...

If an ASP.NET application uses many DLLs, what's the best approach for keeping configurations of every dll separate ?

After creating settings for each dll, a .dd.config file is generated. If that dll would be part of an asp.net application, how to keep this configurations separate for each dll and don't merge them into web.config ? ...