web-config

Error with ASPNET RoleProvider

I just installed an application on a win2003 server and I'm getting this error: Line 149: <roleManager> Line 150: <providers> Line 151: <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, Public...

Using different Web.config in development and production environment

I need to use different database connection string and SMTP server address in my ASP.NET application depending on it is run in development or production environment. The application reads settings from Web.config file via WebConfigurationManager.AppSettings property. I use Build/Publish command to deploy the application to production ...

Alternatives to using web.config to store settings (for complex solutions)

In our web applications, we seperate our Data Access Layers out into their own projects. This creates some problems related to settings. Because the DAL will eventually need to be consumed from perhaps more than one application, web.config does not seem like a good place to keep the connection strings and some of the other DAL-related...

asp.net help resource location

I have a relatively simple site that I'm working up for an intranet environment. The pages have a hook to display a simple bit of text (possibly with a bit of HTML for markup purposes) for help when the user clicks a link on the page. I'm debating whether to put the help snippets in their own XML file or create a section in web.config. T...

.Net 1.1 Web application is picking up web.config from root folder

I have a .Net 1.1 web application sitting in a folder called C:\inetpub\wwwroot\MyTestApp, where 'MyTestApp' is a virtual directory and is configured to be on ASP.Net version 1.1.4322 in IIS 5.1. In the root directory (C:\inetpub\wwwroot) there is a web.config file for a .Net2.0 application, because the root folder contains some web pag...

How do you iterate through custom keys in web.config?

Hi, is it possible to create my own custom keys in the asp.net web.config file and iterate through them with C#? How do you do both (where do I put the key? what format?)? I have an application for an intranet that does certain things based upon the IP address of the client. Instead of hard coding those in the codebehind file, I thou...

Why does global.asax change sql connection?

In asp.net 3.5, I have a problem that if I upload my global.asax to the remote web server, the app starts looking for my local sql server and eventually times out. I use a different config file for the local and remote because of the sql server login. Local is windows auth and remote is sql server auth. However, none of that info is ...

Multiple/Different authentication settings in web.config

How would I go about setting different authentication tags for different parts of my web app? Say I have: / /folder1/ /folder2/ Would it be possible to specify different <authentication/> tags for each folder? I want folder1 to use Windows authentication but folder2 use Forms authentication. I tried doing in a <location/> tag but...

Why isn't my page redirecting to the login screen for this protected page?

Hi, I added the following to my web.config to redirect the user to the login page if they aren't authenticated, but going to the URL does cause a redirect? <location path="user/add"> <system.web> <authorization> <deny users="?" /> </authorization> </system.web> </location> I have setup forms authen. lik...

Single ASP.net site with Multiple Instances & web.configs

We have a legacy ASP.net powered site running on a IIS server, the site was developed by a central team and is used by multiple customers. Each customer however has their own copy of the site's aspx files plus a web.config file. This is causing problems as changes made by well meaning support engineers to the copies of the source aspx f...

Tool for comparing web.config files

Is there a good tool to compare specifically web.config files to find specifically which settings are different values and which file has settings that don't appear in both. XML comparison should do the trick, or an XSLT might work. There must be a tool for web.config settings out there? ...

How do I store a dictionary object in my web.config file?

I'd like to store a simple key/value string dictionary in my web config file. Visual Studio makes it easy to store a string collection(see sample below) but I'm not sure how to do it with a dictionary collection. <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt...

Server Error in '/DNNTest' Application

Parser Error Message: The entry 'SiteSqlServer' has already been added. Source Error: Line 23: providerName="System.Data.SqlClient"/> --> Line 24: < ! -- Connection String for SQL Server 2000/2005 --> Line 25: <add name="SiteSqlServer" connectionString="Server=(local); abase=DotNetNuke2; uid=nukeuser;pwd=dotnetnuke;" providerN...

Problem implementing Paul Johnson's Web Widget code, it works in VS 2008 but not in deployment to IIS 6.0

Using the instructions from Paul Johnson's Web Widgets page I created my own custom widget. However because I was deploying to IIS 6.0 I utilized the web.config change recommended to render the page since the IIS 7.0 configuration management option was not available in IIS 6.0. The widget renders correctly when debugging with VS 2008. ...

ApplyWebConfigModifications not working in the Farm

So, I am trying to deploy a Web Application feature that updates the web.config using the WebConfigModifications collection. There is lots of information on doing this including all the issues you run into so I am very confident in the code but no matter what I try the config elements are not added to the web config. This works fine in t...

NHibernate.Caches.MemCache web.config for cache expiration time

I'm migrating to Nhibernate 2.0 GA but have some trouble with setting cache expirations in memcached provider. I see in the NHibernate.Caches.MemCache sources that there is a property for expiration and a default value for 300 seconds. There are also properties for cache regions but the config section handler does not seem to map them...

What's the difference between <system.web> and <system.webServer>?

Every time I have to add a handler or module for ASP.NET w/ IIS7, the instructions always tell me to put it into two places, the system.web and system.webserver. <system.web> <httpHandlers> </httpHandlers> <httpModules> </httpModules> </system.web> And this: <system.webServer> <modules> </modules> <handler...

How do I turn off custom error handling in IIS for my web site?

How do you even look at the web.config file? I don't know where to go to turn custom errors off...help! I tried command prompt and java script....can any one help me? ...

Can I Add ConnectionStrings to the ConnectionStringCollection at Runtime?

Is there a way where I can add a connection string to the ConnectionStringCollection returned by the ConfigurationManager at runtime in an Asp.Net application? I have tried the following but am told that the configuration file is readonly. ConfigurationManager.ConnectionStrings.Add(new ConnectionStringSettings(params)); Is there anot...

Change Key/Value pairs in Web.config

Hi, How can I change a key's value in web.config which is defined between appSettings tags at code behind in asp.net Thanks.. Regards... ...