web-config

HttpRequestValidationException showing YSOD despite customErrors section.

Hi, we've modified our customErrors section to protect against the recent ASP.NET vulnerability. Our problem is, that HttpRequestValidationException's are now causing a YSOD's to be shown, other exceptions and page not found errors are showing our custom error page. If we change the redirectMode to ResponseRedirect everything works fi...

Enable basic HttpBinding without SSL in WCF

The idea here is that for my testing, before I commit to purchasing the SSL certificate, I want to enable the WCF service in non-ssl mode. I've done it in the past using this code, but for the life of me, cannot figure out how to translate it into the web.config file. If someone can put me in the right direction on how you would go abo...

Error Handling on root website with no application

I have a root website with no application. Then under that root site are four virtual directories with applications. Each of these applications has good error handling. The root website has none. I added a web.config with a simple customerrors="remoteonly" and a redirect to the default error page which is a simple .htm file on this r...

How to change Asp.net Theme via Web.Config on the fly

Summary I have a web-application with more than 5 themes. Each themes covers a completely different style for different customers. whenever we publish a new version of our application we send it for all of customers. The problem. We specify theme in web.config file in <Page> tag. like <page theme="Theme1" /> // or Theme2 for second c...

.NET tracing not working with Diagnostics.TraceSource, only Diagnostics.Trace

I’m trying to set up .NET tracing. I’m able to get basic tracing to work via System.Diagnostics.Trace, but for complicated reasons I have to activate tracing via System.Diagnostics.TraceSource objects (the new way of doing it, since .NET 2.0) rather than using System.Diagnostics.Trace. I've tried everything but it just doesn't want to ...

hosting mojoportal on plesk and getting web.config error

hi! i am trying to host mojo portal 2.2.7.9 on Plesk but getting the following error. i have changed to but its showing the same error page..pls help!!!!: Server Error in '/' Application. Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details...

Where should connection strings be stored in a n-tier asp.net application

Folks, I have an ASP.NET project which is pretty n-tier, by namespace, but I need to separate into three projects: Data Layer, Middle Tier and Front End. I am doing this because... A) It seems the right thing to do, and B) I am having all sorts of problems running unit tests for ASP.NET hosted assemblies. Anyway, my question is, w...

Disabling themes in a subdirectory with ASP.NET

This should be a simple one. I am using a program that has themes defined in its Web.config file. I want to turn these off for a subdirectory. I copied Web.config into a subdirectory and tried removing the theme attribute from the pages element on Web.config but that didn't get me anywhere. I got a bunch of errors about elements that ar...

How could I get the value of the authorized users from the location path in web.config?

This is part of my web.config <location path="Secure"> <system.web> <authorization> <allow users="SecureUsers" /> </authorization> </system.web> </location> I want to be able to search for path of Secure and find out the user role that is specified. My input is the path, such as "Secure" and the value ...

Provider not found when encrypting web.config

I'm trying to encrypt a custom section in a web.config file. When I get to the line that calls ProtectSection(), I get an exception saying the provider isn't found. Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath); ConfigurationSection section = config.GetSection("MySection"); section.Se...

Adding machineKey to web.config on web-farm sites

We (out IT partner really) recently changed some DNS for a web farmed site we have so that the two production server have round-robin DNS switching between the two. Prior to this switch we didn't really have problems with WebResource.axd files. Since the switch, when we hit the live public URL, we get an error: CryptographicException...

RIA Services why does VS 2010 not generate an App.config when there is no EF model?

We always generate our RIA services as a "WCF RIA Services Class Library". When we generated one for POCO, without first adding an EF model, we noticed the App.config was not generated. After testing we found the settings are only added to App.config if the App.config file already exists in the project. Is this just a bug in VS 2010?...

How to make use of RIA Services App.config files (without copying settings to web.config)

Even though I link my web-app with my RIA Services.web library, the App.config setting files are never used and I always need to copy the module settings manually to my web.config. Am I doing something wrong? Should the App.config file be recognised and automatically loaded? ...

<rewrite> not a valid child of <system.web> ?

Hopefully I am just overlooking something incredibly simple, if so I apologize.... I have an ASP.NET application in .NET4 and we're trying to use URL rewriting using <configuration> <system.webServer> <rewrite> <rules> <rule....> For some reason intellisense is returning an error which says th...

Can the tilde (~) Web application root operator be changed without access to iis?

I'm uploading a website to a subfolder on a remote server. The root folder is defined as an application, and has its own web.config file. The server uses iis7 but I don't have access to it, is it possible to define the root web application operator (~) in the subfolder webconfig file, or any other way without access to iis? ...

Read config file using XMl reader

I have a bunch of key in AppSettings section of my web.config file. I want to read the key and values of those app settings using XML reader technique and populate them in the list box. ...

Authorization in ASP.NET MVC 2 using web.config file

Hi, I have an ASP.MVC 2 web page and I have my authentication done like this: FormsAuthentication.SetAuthCookie(user.UserName, false); FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(1, "fooPage" + user.UserName, DateTime.Now, DateTime.Now.AddMinutes(10), false, String.Empty); HttpCookie cookie = new HttpCookie(F...

asp.net big applications, several developers and manage changes of web.config file

Hi Guys, The problem - a big asp.net applications (libs, frameworks, models, everything inside) having web.config file and several developers work on this project. How to make the same "core" shared between all of them, so they don't change the core, but only change the user-specific values that never comes back into code (mercurial) re...

Unity Configuration using multiple config files

Is there a way to configure a container in multiple configuration files? For instance, I want to register types for a container in a web.config file located at the root and also register types for the same container (and others containers) in the web.config file of sub-folders. And also register other types for others containers in a...

maxRequestPathLength not in ASP.NET 4 documentation and doesn't work

If I try to use the new maxRequestPathLength settings in an ASP.NET application it does not work. I get an unrecognized attribute error. I've tried using both ASP.NET Integrated and Classic application pools in IIS 7. What is also funny is that if you search for maxRequestPathLength on MSDN it is no where to be found in the documentat...