getting an Error when refering an external config file from web.config file

am getting an Error when refering an external config file from web.config file, code is


<appSettings >
     <add key="KeyToOverride" value="Overridden" />
     <add key="KeyToBeAdded" value="EntirelyNew" />




   <appSettings file="YourSettings.config">
     <add key="KeyToOverride" value="Original" />
     <add key="KeyToNotOverride" value="Standard" />
and in code behind

string str = System.Configuration.ConfigurationSettings.AppSettings["KeyToBeAdded"];

the Exception is

The root element must match the name of the section referencing the file, 'appSettings' (c:\inetpub\wwwroot\referexternalfiles\firstfile\YourSettings.config line 10)

plz help me

4/24/2006 10:51:47 AM 12495 articles. 0 followers. Follow

0 Replies

Similar Articles

[PageSpeed] 17


Similar Artilces:

one application has many web.config files which web.config file execute first?
hi to all In my application i will add three web.config file which will execute first. how to set it. Give me a guidlines. by Devan.G Hi,You can't add multiple web.config to applicationYou can add single web.config to each folder present in sub directories of your applicationYou can override the web.config files using multiple config files.SatalajWatch The true story of internet ||Yet another forum |||I'm big fan of Open source flash chart for .net very very simple I n t e r v i e w T i p s Hi, You can check this reference:

Need to put this in a web.config file. Transfer a collection from app.config to web.config.
<!--<setting name="Groups" serializeAs="Xml"> <value> <ArrayOfString xmlns:xsi="" xmlns:xsd=""> <string>GL CA Corporate Data</string> <string>GL CONT Contractors</string> <string>GL IT SolutionDelivery</string> </ArrayOfString> </value> </setting>-->   I need to put this in the below web.config.<?xml version="1.0"?><!-- Note: As an alternative to hand editing this fi...

how to avoid child config file not to get httphandlers from parent config file
Hi, I have a config file in root folder of a project and there is one more config file in sub folder. Like projectRoot/web.config --> parent config and projectRoot/subFolder/web.config --> child. Now my problem is, there are some httpHandlers in parent config which i don't want in child config. If i use <clear/> tag in <httpHandler>, it is clearing all httpHandlers which exists by default for all config files. Then i am getting error there is no httpHandler for GET.  Can any body help me out. Thanks in advance.   You can use the <remove>...

Use a Name/value in Machine.config file in the web.config file
Hello. I want/need to access a variable in the machine.config file and use it in the web.config file. My scenario is: Each machine has a machine name, so (I assume this is the best place to put it) I want to create a variable in <appsettings> in the machine.config file called "MachineName".  In my web.config file, I want to use the MachineName variable in the machine.config in the appsettings.   Example: (web.config file)  ... <appSettings> <add key="ServerFileNames" value=\\ISCO1FEGRD\Dotnet_files\OrclIntlList.xml /> Replace the ...

After migration from .Net 1.1 to .Net 3.5 do I have to incorporate new web.config settings in old *.config file
Hi,I have successfully migrated web application from .Net 1.1 to .Net 3.5. Could you let me know whether I have to incorporate setting in new web.config (this new web.config file was generated automatically due to migration) into old *.config file?FYI: Old *.config file contains all application level settings required. So I will continue to use old.config file by removing new web.config file. Settings which are in new web.config file are:<configSections><sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup,...

Web.Config and App.Config has key that refers to a file in a parent directory ? How To?
<add key="AccountSettingsFile" value="../../../Config/Accounts.Config"/>Don't ask my why but I need to do this and the above doesn't work.How do I refer to "Account.Config" that is in Folder "Config" which in turn is two directories up.Thanks....

Visual Studio 2005 Profiler "Launch Error: The web.config file xxx\web.config has been changed and backup information was lost."
Hi,  I am experiencing this error when trying to start a Visual Studio 2005 profiling session (Instrumentation) for my ASP.NET 2.0 web application.  I could not find any information regarding this issue and have no idea what might cause the problem, as the Visual Studio 2005 profiler already worked with that very same application, a couple of weeks ago. Anyone? Thanks in advance! Hello, Can you tell me if you found a solution for the issue because I'm experimenting the same issue ? Thanks !...

Config file web.config with System.Configuration ?
 Hi all!I write a application for configure file web.configConfiguration config = WebConfigurationManager.OpenWebConfiguration("/" + appPath);In file web.config ...<authorization>            <deny users="?"/>      </authorization> ...I need to set authorization from <deny users="?"/> to <allow users="*"/> in this application.How can I do? Please, help me!Thanks! Hi phanhoangduc, As far as I know, you can use WebConfigurationManager cla...

web.config file of root directoy interferes with the sub-application web.config.
Hello! I encountered a problems when I added new sub-application to my application,  with its own web.config, When I try to open page It reads the web.config of and throws an exception (I think it tries to loadsome dlls from root-bin directory (exactly ATLAS files..)  <add name="ScriptModule" type="Microsoft.Web.Services.ScriptModule"/> - exception on this line ) But why it reads the web.config of root dir? What can I do to solve that problem? Thank you.Artashes This is the expected behavior. web.config are inher...

How to refer external Configuration file into Web.Config ?
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 ...

Error: Server Error in '/' Application. The "web.config" file is attached for your reference.
Dear All, I receive the following error & the web.config file is copied below for your reference. body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } ...

Multiple Errors From Chnaging Web.Config File With New Ajax File
 Hi Well basically, I want to use the features of ajax in an existing web application, but when I insert the new web.config file into my web.config file. I get around 31 messages and several warnings such as the 'RequiredPermission' attribute is not declared the 'RequiredPermission' attribute is not declaredMessage    30    Could not find schema information for the element 'add'.  Message    10    Could not find schema information for the element 'modules'. Messag...

How to confige the web.config file to see in client Computer
I am a dot net studying student. here i am useing windows 2003 server service pack 2 as server and i have installed visul web developer 2008 and IIS v6.0. when i develope a new ASP.NET wib site using visual developer 2008, the web page is displyed in the browser in debbuging mode (i.e) only in server, but when i try to open the page from any one the node that means the client connected to the server the follwing error is occured. the error given is showned inthe browser.Server Error in '/ss' Application.Configuration ErrorDescription: An error occurred during the processing of a conf...

Is there any way to include another config file in web.config
 hi,  I am developing a Web Application in VS 2005. While I deploy my application to my webhost, I don't know if we can do something like this, for example on database connection, Web.Config........<DBSetting ConfigFile="DBSetting.config" /> .....Then, on my machine, the DBSetting.config would have the connection string to my local database, on server the DBSetting.config file would have the connection string to my hosted database. By this way, I can always use the same Web.Config file both on my local machine and host server. Otherwise, every time, when I ...

Web resources about - getting an Error when refering an external config file from web.config file -

Astronaut Pete Conrad's autograph to my dad - Flickr - Photo Sharing!
On the 25th anniversary of Apollo 11 in 1994, my dad got a magazine article about Pete Conrad signed by the astronaut. My dad worked on the astronaut's ...

Talk:Applet - Wikipedia, the free encyclopedia
This article is within the scope of WikiProject Computing , a collaborative effort to improve the coverage of computers , computing , and information ...

Pop goes the music games
Pop goes the music games

Iran: Ahmadinejad is 'Socrates of third millenium', says president's office - Adnkronos Politics
Iran: Ahmadinejad is 'Socrates of third millenium', says president's office

CMI - AfterDawn: Glossary of technology terms & acronyms
... - Tech Support - Forums - Profiles Home Glossary AfterDawn > Glossary > CMI CMI CMI is a term that means Copy Management Information, refering ...

skip to main skip to sidebar About us - Elections - Gay GOP Primary Schedule - Elections - Romney Economic Crisis - Jobs - TSA - Limbaugh - Fun ...

Coronation Traditions in Imperial Ethiopia
The Emperor of Ethiopia was crowned by the Archbishop of the Ethiopian Church appointed by the Patriarch of the Coptic Orthodox Church, the Pope ...

The Modern Financial Asset Pyramid
The lower you are on the pyramid the better off you are. As Max Keiser says, refering to derivatives and exotic paper, they've made cotton candy ...

Gary Sharma’s Highlights from F.ounders NY 2012, the Michael Jordan of Tech Events
... now is on retention" said Rick. They're planning to roll out a new user interface in a couple of weeks. "I've made my money." he said refering ...

Windows 8 from a gas engine to hybrid!
... to developing primarily for the desktop. I, like an old-time mechanic, do feel rightly concerned when I hear terms like "legacy" when refering ...

Resources last updated: 1/21/2016 12:52:20 AM