web-config

Reading Web.config Many times and performance

If i am reading one of my application settings from the web.config everytime when each of my ASP.NET page loads,Would it be a performance issue ?I m concerned about memory too. ...

How to debug web.config for a SharePoint 2010 application to make sure your c# code can access modified parameters in web.config?

I am trying to access some key=>values in appSettings in my web.config but keep getting an error: Object reference not set to an instance of an object. I would assume this means that it cannot find the values in SharePoints web.config file. I have added this: <appSettings> <add key="SAWServer" value="http:/...

Auto Encryption of web.config connection string

I want to encrypt the connection string in web.config, the problem is each time a developer changes the connection string in web.config and publishes, it needs to be encrypted every time in the web server. Is there any way that the connection string can encrypted automatically every time someone publishes it? Note :- All of us work on o...

Provider information is not pulling from the MVC project's Web.Config

I'm working on branching my services of my MVC solution to a separate project, which includes a MembershipProvider wrapper. The problem is that when doing my unit testing, the provider information being used isn't coming from the MVC project's Web.Config file (e.g. the connection string), but some default settings. I have the feeling, th...

CustomError not working properly

Hello friends, I am using following setting for customError. < customErrors mode="On" defaultRedirect="GenericErrorPage.aspx" > < error statusCode="403" redirect="NoAccess.aspx" /> < error statusCode="404" redirect="FileNotFound.aspx" /> < /customErrors> I have a folder "Admin" having access to administrators role. When ...

Is it possible to suppress the IE standard login dialog when Windows Authentication is enabled?

Hello, i have a web application with Windows Authentication enabled. In my web.config I restrict the access with the following code: <authorization> <allow users="rba\eigg"/> <deny users="*"/> </authorization> When I call the application in a browser, the IE's standard login dialog pops up. If I close it by 'Cancel' I get the H...

Parameter count does not match Parameter Value count.

Hi, We're getting a server error saying "Parameter count does not match Parameter Value count." Anyone have any idea what this could mean? http://www.oneworldunited.com Our site's on ASP.NET Webforms running DotNetNuke as a CMS. I've tried uploading an older version of the web.config file but it doesn't seem to have changed since th...

Explain Entity Framework 4's connection strings

I created an Entity Framework file. My database is called MyDB. My Entity Framework file is MyDB.edmx and I used an existing connection string (MyDBConnectionString) to generate the edmx model. It created two more connection strings: MyDBEntities MyDBContainer What are these for? They look exactly the same and both have the informat...

How do I use Visual Studio 2010 config transforms for the applicationSettings section of the web.config?

I just upgraded to Visual Studio 2010, and I am playing around with the Config transforms option for web application projects. I see in the example file how to change the connection strings, but I want to change settings in the applicationSettings (Not appsettings) section. I have not been able to find any information on this. I tried ...

How to include simple collections in ConfigurationSection

Is there a way for me to include a simple array of strings, or List<string> on my custom subclass of ConfigurationSection? (Or an array or generic list of simple data objects, for that matter?) I'm becoming familiar with the new (and VERY verbose) ConfigurationSection, ConfigurationElement, and ConfigurationElementCollection classes, b...

How to secure connection strings in VS?

I see several others have posted this question, however, none of the solutions I've tried have fixed this yet. I have a 32-bit XP running VS 2008 and I am trying to encrypt my connection string in my web.config file. But I am getting the error: The configuration section '...' was not found. Failed! The command I give it: C:\Progra...

Seriously, what's the deal with InheritInChildApplications? Does this work for anyone??

I've tried wrapping my <system.web> with <location path="." InheritInChildApplications="false"> like this <location path="." InheritInChildApplications="false"> <system.web>...</system.web> </location> But VS 2010 Web Developer Express keeps saying "The 'InheritInChildApplications' attribute is not allowed" and when I run my w...

Forms Authentication logs out very quickly , locally works fine !!!

Hello to all, There's a problem that i am facing with my hosting company, I use a project that uses FormsAuthentication and the problem is that though it successfully logs in, it logs out VERY QUICKLY, and i don't know what could be the cause of that, so in my web.config file i added those lines: <authentication mode="Forms" > <forms...

VS2010 development web server does not use integrated-mode HTTP handlers/modules

I am developing an ASP.NET MVC 2 web site, targeted for .NET Framework 4.0, using Visual Studio 2010. My web.config contains the following code: <system.webServer> <modules runAllManagedModulesForAllRequests="true"> <add name="XhtmlModule" type="DomenicDenicola.Website.XhtmlModule" /> </modules> <handlers> <...

Finding final/effective web.config values (from inherited configurations)

Are there any apps that can show the final configuration as applied to a particular application directory? What I'm picturing is something along the lines of FireBug's CSS viewer. Basically, it should show the equivalent single web.config file (as if you only had one), with all the values that apply to the directory in question, with e...

Web Service URL change is not recognized

I deployed in a production environment a .net solution that consumes a web service added as "Service reference" in visual studio. Today the endpoint URL has changed, and I modified that URL in web.config. But when I run the solution I get the error: System.ServiceModel.FaultException: Server did not recognize the value of HTTP Header S...

What ASP.NET Web Config entries could limit certain file access by date and time?

What entries in a web.config could allow certain files to become publicly accessible after a certain date and time? Specifically, we have these files starting with AB_.jpg where the _ could be anything. We put them in a folder on April 27th for example, but they shouldn't be accessible until April 30th at 11:59:59 PM. I think the web....

Does an HttpHandler require an aspnet_isapi.dll mapping

Hi, If I configure (via web.config) an httphandler to handle all .gif requests for a specific folder, is it absolutely essential for me to map .gif requests to aspnet_isapi.dll in IIS? Is there any other way of ensuring that the .gif http request will be handled by aspnet_isapi.dll? I have a server configured where the virtual dir tha...

Web.Config issue with Unit Testing

I am trying to unit test a lot of my MVC controllers, but unfortunately it keeps failing because it needs a lot of settings from the web.config.. Which I copied over but does not read it, what I'm needing is the membership and rolemanager but I can't just add it to the app.config either, which I've been able to get the connection string...

Requiring Multiple Roles in Web.config Authorization

Is it possible to specify that multiple roles are required inside the authorization element of the web.config file? I currently have this block in one web.config of my site for a specific directory: <authorization> <allow roles="Global, Region" /> <deny users="*" /> </authorization> I've just identified a special case where ...