web-config

ASP.NET Configuration granularity between Machine-level and Site-level?

I want to be able specify to do the following: Specify configuration settings such as appSettings and connectionStrings for multiple web apps in IIS7 No editing Machine.config or the machine-level web.config Web apps are distinct web sites in IIS (not subfolder apps) Is this possible without just duplicating the configs for each app?...

ASP.NET configuration inheritance

I have an ASP.NET application that defines a custom configuration section in web.config. Recently I had a customer who wanted to deploy two instances of the application (for testing in addition to an existing production application). The configuration chosen by the customer was: foo.com - production application foo.com/Testing - test...

Is it possible to create a http module without making an entry into the web.config or GAC?

The title is my question at this point. Is it possible to create an http module without making an entry into the web.config or GAC? ...

How to catch ConfigurationErrorsException for violating maxRequestLength ?

I am limiting file size users can upload to the site from Web.config. As explained here, it should throw a ConfigurationErrorsException if size is not accepted. I tried to catch it from the action method or controller for upload requests but no luck. Connection is resetted and I can't get it to show an error page. ...

"Unrecognized configuration section exceptionHandling" in WCF service when using Enterprise Library

I am working on a WCF service and want to use the Enterprise Library ExceptionHandling block to send the fault message back to the client but I am running into a problem. I have found very little on the web about this error. I added the exceptionHandling block to the web.config and also a reference to exceptionHandling in the configSec...

Where should I set generatePublisherEvidence to false in an asp.net app?

To reduce the loading time this blog suggests we set generatePublisherEvidence to false in the app.config for executables. <configuration> <runtime> <generatePublisherEvidence enabled="false"/> </runtime> </configuration> Where do I set it for web apps? The blog suggests that this does not go to the web.config. Whe...

How does my ASP.NET app get the SMTP settings automatically from web.config?

I noticed that we always just are like: SmtpClient mSmtpClient = new SmtpClient(); // Send the mail message mSmtpClient.Send(mMailMessage); And the only place the credentials are set are in web.config: <system.net> <mailSettings> <smtp> <network host="xxx.xx.xxx.229" userName="xxxxxxxx" password="xxxxxxxx"/> ...

How can I set a default content-type of text/html in my web.config?

I'd like to set the default content-type for web pages in my ASP.NET MVC application to text/html. I know this can be done by adding a ContentType="text/html" to all of my <%Page%> elements, but I'd prefer to use the web.config instead. How can I do that? Thanks, Adrian Edit: I know that "text/HTML" is the ASP.NET default, but for u...

Migrating to web application with AjaxControlToolkit

Hi All, We are currently migrating our ASP.NET website to a web application in Visual Studio 2008. Most of the process has been fairly straight forward, but I have hit one block that is driving me a bit nuts. We are using the AjaxControlToolkit for some functionality, specifically an AutoControlExtender. When this is run locally throu...

Exclude files only in "release" in VS2008 config

Hi Guys, I was wondering how to "Exclude" individual files in the "release" web.csproj config of my solution. I've seen other answers and they all feature "include" - but this is not what I am wanting to achieve. I only want to exclude around 10-15 files from a "release" package ? I don't want to manually edit the web.csproj file - so ...

ASP.NET Emails blocked by Spam filter on Exchange

I'm trying to send an email via some C# ASP.NET code. This is being sent to our internal mailrelay server, with our standard "from" address (e.g. [email protected]). In some instances, this is getting through OK, in others, it's getting blocked by the Spam Filter. An example of our Web.config <mailSettings> <smtp from="no-reply@dom...

IIS url rewrite rewriting all .asp to .html

I need to create rules for web.config that will rewrite all requests for files with extension .html to .asp and redirect all .asp requests to .html Example: file_xyz.asp rewrites to file_xyz.html directory1/file_xyz.asp rewrites to directory1/file_xyz.html and file_xyz.html redirects to file_xyz.asp directory1/file_xyz.html redire...

Could not load file or assembly 'System.Web.Ajax, Version=3.0.31106.0

HI folks, I have a .net application (vb.net) and I'm using the ajax control toolkit. It works fine on my production machine but when I upload it to the host (fasthosts) i get this error: Could not load file or assembly 'System.Web.Ajax, Version=3.0.31106.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. T...

Oracle Schema Name

How can I include the schema into my connection string inside my web.config. ...

Are the old httpHandlers and httpModules elements needed in IIS7?

I'd like to clean up the web.config and remove unneeded XML. A default ASP.NET 3.5 web application has the follow elements in the web.config: <httpHandlers> <remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Cul...

Clean Web.Config file in Asp.NET 4.0?

Okay, I am wondering having clear web.config file could be good but you know some shared web hosting companies don't allow us to touch things like machine.config and etc. So If a lot of things have been moved onto machine.config, then will we be allowed to change things like we used to through web.config file. ...

Can i read data from web.config using JQuery ?

Can i read data from web.config using JQuery ? ...

Does <httpRedirect> in web.config work in a mono setup? Or is it IIS7 specific?

We had some content restructure recently and I'd like to put in some redirect rules into web.config so bookmarks to the old pages can get routed to their new locations/pages. I tried using this approach: <location path="~/product/productA.aspx"> <system.webServer> <httpRedirect enabled="true" destination="~/product/category...

How to use the new VS 2010 configuration transforms and apply them to other .config files?

I have setup some configuration transforms in my web.config for my connectionStrings, etc. But I have separated out some areas of my web.config into separate files, ex) appSettings.config. How can I configure Visual Studio and MSBuild to perform config transformations on these additional config files? I have already followed the appro...

Custom Error mode in Web.Config File

Hi All, I have deployed my application on server and Now I am getting this error: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attri...