web-config

How do I add a reference to a server control in my current website to the web.config

I have extended a server control (not a user control) and put the code in my app_code folder. I would like to add a tag prefix to the web config, but <add tagPrefix="cc1" namespace="mynamespace" /> and <add tagPrefix="cc1" namespace="mynamespace" assembly="currentwebsitename" /> don't work. I get this error: Error 147 Unknown s...

Dynamic Connecton String Based on Session Variable

Hey all, I have an application that does projection of data for my client over a length of time. In order to allow the client to 'play' w/ other scenarios w/o messing up production data, they are able to choose alternative databases (basically What-If scenarios) at any point, which are a copy of the production database as of a given ti...

Why is HttpContext.Session null when redirectMode = ResponseRewrite

As is suggested elsewhere, I am using redirectMode = ResponseRewrite in my custom error configuration so my custom error page can access the exception info. This has worked like a charm for some time. In adding some more "help the user recover from an error" type functionality, we need a piece of info that has been previously stored in...

Access config file from a VS Sharepoint Workflow

Hi, I want to store some setting in web.config file of the sharepoint web application or in app.config of the workflow itself. But i don't know how to access neither of these files and i don't know how to handle the data inside them. Please, give some advise, how to do this or where to read about doing this. Any information is helpful....

How to encrypt Connectionstring written in web.config from codebehind?

Hi all, I need to encrypt connectionstring and some appsettings keys value in web.config from code behind. Please help. ...

Dynamically determine session connection string by environment

I'm comfortable with determining connection strings by environmental variable in general, but the connection string that's inherent in the session state section of the web.config file is throwing us for a loop. We want to dynamically determine the connection string that points to the SQL State Server based on an environmental variable...

IIS 6 to 7 is making me scared of web.configs

Hi guys, We have a mixed development environment of three servers running: Win Server 2003 & 2008, IIS 7 & IIS 6, ASP.NET 2.0 & ASP.NET 3.5. Previously, all three servers were Server 03/IIS6/ASP.NET 2.0, but with this new change, I am finding that pushing/moving any applications from server to server is always a terrifying experience be...

.NET DLL Settings and Config when there's a Web Reference - whats going on?

My understanding is, that .NET doesn't really 'do' config files for DLLs - only the main Executable or Web App gets a config file, and all DLLs referenced by the Executable/Web App read from that. But in VS2008, if you add a Web Reference to a Class Library (DLL) project, it adds a Settings.Settings file and an app.config file to the pr...

Is it possible to change IIS settings from web config

I'm using url rewriting.net. I'm testing web on the local host, it is successfully work. But When i deploying web to remote host, url rewriting not work. Problem is (The resource cannot be found). I found problem. My deployed remote host IIS configuration is (Virtual dir->Properties->Home directory->Application Mapping->.aspx->Edit->"Che...

How to resolve nested conflicting web.config entries on sub web applications?

I am trying to run a standard SubText blog engine as a sub application to a standard MS MVC website. The Web.configs have conflicting entries. I know there is some way to limit the scope of these entries in the web.config, but I have yet to make it work. Any ideas? I tried using a <location> tag but it cannot exist at a root xml leve...

Accessing Custom configSections in Web.Config from Custom Assembly in SSRS

I am trying to allow my custom assembly to utilize the Report Server's web.config file during report rendering. Currently, the custom assembly code can access the ConnectionStrings and AppSettings from the web.config, but when I try to access customer config setting via System.Configuration.ConfigurationManager.GetSection("") I get a typ...

ASP.Net Session State not enabled properly

I'm having trouble getting Session State to work correctly in my ASP.Net application. I've set EnableSessionState="true" in all my <%@ Page %> directives but I still seem to get issued a different Session ID on every page. I am using a Master Page which I can't find a way to specify EnableSessionState for (I assume if the Page using it...

Reading from web.config while running Pex explorations

I've just started using Pex to generate parameterized unit-tests for my project. However, when I let Pex run its explorations, my code crashes because it cannot read from the web.config (ConfigurationSettings.AppSettings has zero elements to be more precise). The working-directory during the explorations is: "C:\Program Files (x86)\Micro...

Setting Default URL in Web.Config for website (Routed page!)

This is a follow-up on this question. I basically have the same question as this question, but with a few differences. First of all, my url is http://site/Image/Cassandra/Image.aspx and I want to see http://site/Image/Cassandra instead. This is a routed page where I use ASP.NET routing to translate an url to the one above. But somehow,...

Calling Service Lbrary from Web Project - What Goes In Web.Config?

Hi Foks. I am new to WCF and am working on a project where I am building a WCF library that is called by a Web project (ASP.NET 2.03.5 / C#). I have a few things going on here. 1) I have provided a compliment contract (IJSON) for my SOAP contracts (ISOAP) for my JSON web methods. 2) I have one contract, IFileTransferService, that ...

Handling invalid values in web.config

If an entry in a web.config file is an invalid value should I throw an exception or set it to a default value when I read it from my application. For example: <add key="enablePasswordReset" value="Invalid"> If my application reads this and wants to store it in a Boolean property, should I throw an exception or set it to the default ...

Sending email with the MS Enterprise Library Logging Application Block via smtppickupfolder?

I like the MS Enterprise Library Logging Application Block because it lets me easily define a few logging settings and then log an error in a line or so of code from my application. However, I really want to be able to send email using my SMTP server's pickup folder (as opposed to specifying the servername and port). Just using the plai...

SoapExtension not loading.

Hi I'm trying to write a soap extension. But the framework is not loading it. I've added to the web.config <webServices> <soapExtensionTypes> <add group="High" priority="1" type="Lisa.Admin.SoapExceptionExtension,Lisa.Admin" /> </soapExtensionTypes> </webServices> and even if I change the type to some bullshit It does n...

Can I use wildcards in the web.config location path attribute?

In IIS 7 I try to deny access to all files with the extension .xml for all users. I tried the following setting in my web.config file: <location path="*.xml"> <system.web> <authorization> <deny users="*"/> </authorization> </system.web> </location> But then getting any file results in an internal server e...

Project load wrong web.config file

Hi, I am using Visual Studio 2008 for .net project. I have configured to use IIS as debug web server in the project property page. I have two projects under c:\project, project1 and project 2. I can run project 1 with no problem. However when I try to run project 2 I got an error message, saying the web.config file is missing binary ...