Merging my web.config.mylibrary with the web.config

I see multiples web.config files in the framework 2.0 folder.  There is a way to had a web.config.mylibrary file that contains part of the configuration section.
For example, I want that the profile section to be in the web.config.mylibrary file and when the web site will be load, the two web.config will be merge.  Is it possible to such thing ?
0
bizbiz
10/14/2005 2:47:23 PM
asp.net.config-deploy 12495 articles. 0 followers. Follow

4 Replies
1002 Views

Similar Articles

[PageSpeed] 10

Hi Biz,

It is possible to-do this using the configSource property on configuration section elements.  You could then store different configuration sections in different configuration files in a distributed way.

Here is a MSDN article that provides a little more detail on this: http://msdn2.microsoft.com/en-us/library/ms228167

Hope this helps,

Scott

0
ScottGu
10/15/2005 9:53:51 PM
This article also covers this scenario more and provides a good overview of some of the new capabilities with configuration in V2: http://odetocode.com/Articles/418.aspx
0
ScottGu
10/15/2005 9:55:36 PM

Thank you for the anwser ! But, what I was trying to do is something like inheritance of web.config files.  I explain more.  I work on a library team for my compagny and we want to distribute somes settings in the web.config files and have plain control of this settings.  So, for this settings, I think of the profile properties, globalizations sections... Somes stuffs like this.  And with your article, it provide me the way to do that with multiple xml files, one for each sections.  But, I was hoping to put all the sections in one config files and not multiples.  But I cannot do that because I cannot have multiples sections at the same level.

myLibrary.config

<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="auto" uiCulture="auto" />
<
profile enabled="true" >
   <
properties>
      <
add name="SLCulture" type="System.String" />
      <
add name="SLTheme" type="System.String" />
   </
properties>
</
profile>

In my main web.config, on the globalization and profile elements, I put configSource="myLibrary.config".  But, I have an error telling me that I cannot have multiples elements at the same level.  These elements are in the system.web section.  But, I cannot put all these section in the configSource file because it can change by application.  So, I don't find any others way to do that.  I think it's not possible to do.  Do you have an idea to help me ?

 

 

 

0
bizbiz
10/17/2005 11:48:26 AM
Hi BizBiz,

You can only use configSource on actual configuration sections -- and not their sub-properties.  So for the scenario above you could use it on <profile> or <globalization> -- but not on sub-elements like <properties> or <add>.

Hope this helps,

Scott
0
ScottGu
10/17/2005 4:34:43 PM
Reply:

Similar Artilces:

running 2 web.configs in the same website 1 in /web.config and one in /swf/web.config
Im having issues doing this. and when i remove the authentication from the swf/web.config it still doesnt seem to be applying to the child website at all. Whats the proper way to set a child website? Thanks!!  The lower most web.config overrides all previous settings. So if you remove the section from the /swf/web.config whatever settings you have in the web.config in the next higher level will have an effect on the content of the child folder.So instead of removing a section, try giving appropriate settings in the /swf/web.config....

How do I merge web services' app.config with web app's web.config? Help!!
I have a web application project that uses a separate class library containing web service references (service layer). I want to be able to configure the web reference URLs dynamically and I know you can set this up by setting the URL behavior to  'Dynamic', etc, etc. The problem is VS2005 puts the URLs in the project's app.config file. When the class library becomes a DLL component, I have no way of accessing the app.config file.Is there a way to make the web reference project to look for the URLs in the web.config instead of its app.config? Or is there a way to merge this app.config w...

Web Deployment Project - Config Properties
I'm using a Web Deployment Project to compile my web site. In the Property Pages - Configuration Properties - Deployment section, there is an option to 'Enable Web.config file section replacement'. I have this working to replace certain sections of my web.config for each build config (release/staging/dev). I think this makes sense so other developers do not have to remember to change the web.config file. HOWEVER, this only seems to work when replacing parts of web.config; such as appSettings, connectionString, etc. This would require me to have separate config files for each section and bui...

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="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <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...

Should local Web.config overwrite Production Web.config
I have a hosting service that supporst ASP.net 2.0.  I have an SQL Server 2005 Express account with them.  I have just started using them and have written my first web app. I have read quite a few things but it is not clear to me whether or not when I copy my web site (using VWD) if I should copy the web.conf file or not.  My local app runs fine but after copying everything to my production web site, I am not able to access the production web site in my browser.  I suppose it may have something to do with the question I've asked concerning Web.config. Is there a partic...

Web deployment project will not merge web.config
I have it merging _most_ web.config changes, like <appSettings> and such.   However, I cannot get it to merge the <system.net> one, which has my smtp server specified.  Build always says it cannot find the <system.net> section, which is definately there. Thanks for reporting this. We are currently investigating the cause of the problem (we may be a little slow getting back to you as many people are on vacation). We'll attempt to have a fix available for the next web download.Bill HiebertVisual Studio Web Tools...

app.config and web.config deployments and installers
I use web deployment projects for changing web.config values based on the configuration build types I have setup (dev/test/stage/prod) and it works excellent for building installers in multiple environments.  Now, I am trying to do the same the Windows Applications.  How can I automate the changing of app.config values based on the build configuration (dev/test/stage/prod)?  Any help would be much appreciated. Thanks,Chris...

Read info from web.config, machine.config, app.config....
I know how to read info from the web.config, see code:  Protected path As String = "/Framework" Protected config As Configuration = WebConfigurationManager.OpenWebConfiguration(path) How can I read also the data from machine.config and other config files, like the app.configs?Johan TheunissenMCPD, MCSE, MCTS BizTalk 2006==============================Please mark the most helpful reply/replies as "Answer". ...

Isolating web.config from it's parent web.config
I need to run an application withing a sub-directory of another application. Basically, I need to install an old version of DNN as a subdirectory of a current DNN2 installation. I get a problem of conflicting web.configs. The subdirectory want to use it's parent directory's web.config file. I thought by making the subdirectory an "application" in IIS that it would use the web.config in it's own folder but instead, it is referenceing the web.config file from it's parent. Any thoughts or help would be appreciated. Thanks, Stef. Stef, Because of the hierarchical nat...

App.config to Web.config
I have been running a console app, to process a paypal payment.  The code gets a value from the app.config file. <add key="PAYFLOW_HOST" value="payflowpro.paypal.com" /> However I have now incorporate the code into a web application and put the key into my web.config file, will the code now know to look for this key in this place? If your code is getting the value from your config file using ConfigurationManager.AppSettings["PAYFLOW_HOST"] then it should use the correct config file automatically.  Console apps, windows services and wind...

Web.Config
Hello, I am in .NET 1.1 I have a custom.config to overwrite my web.config file and I would like to centralize the configuration like:is it possible top have several path for the custom files? <files path="~/custom_standard/">    <file ..../> </files> <files path="/custom_specific/">    <file.../> </files> or <files path="~/custom_standard/">    <file ..../> <path="/custom_specific/">    <file.../> </files>   ThanksDom If you...

App.Config/Web.Config
I have setup custom config sections. I need to know how to loop through a configuration group and get all of the config sections in that group. Thanks could you post an example of what you have Trey Exactly, your question is not clear at all. Regards.Bilal Hadiar, MCP, MCTS, MCPD, MCTMicrosoft MVP - Telerik MVP...

Machine.config and web.config
If i have a key named X in my machine.config which equals to the value X and a key named X(same name as the one in the machine.config) in my web.config which equals to the Y.When i use my code to read in the configuration appsettings key.What value will it read in?X or Y? Y The web.config will override values set in the machine.config. You can also overrride values in each directory of your application (or each file for that mater) by setting <location> tags....

Machine.config and Web.config
 I want to know list of settings in machine.config which cannot be overridden in web.config.. Thanks a lot in advance  I don't think that this information is specifically listed anywhere, but you can look in machine.config and look for: allowExeDefinition="MachineOnly"If you're running IIS 7 you need to also look at applicationhost.config and overrideModeDefault="Deny"...+++ Rick ---   Rick StrahlWest Wind TechnologiesMaking waves on the Web www.west-wind.com/weblog Thanks for reply can u tell me how can i look my IIS version...

Web resources about - Merging my web.config.mylibrary with the web.config - asp.net.config-deploy

MyLibrary Mobile on the App Store on iTunes
Get MyLibrary Mobile on the App Store. See screenshots and ratings, and read customer reviews.

Asus Eee Pad Transformer - Wikipedia, the free encyclopedia
For the electrical device, see Transformer . For other uses, see Transformer (disambiguation) . 9.5 hours; 24.4 Wh Li-polymer battery, 16 hours ...

Library Catalogue
The University of Adelaide > Library > Catalogue Library A to Z The University of Adelaide New Search Headings Titles MyLibrary Requests History ...

The University of Newcastle /All Locations
NEWCAT Home MyLibrary Hours Ask a Librarian Search Type1 KEYWORD AUTHOR TITLE SUBJECT JOURNAL TITLE RESOURCE NAME CALL NO ISSN/ISBN Search Search ...

Classic Catalogue - UTS Library
Staff Directory - Campus maps - Newsroom - What's on SEARCH Library Website UTS Website Catalogue UTSePress UTSiResearch Subject Resources eReadings ...

University of Winnipeg Library /All Locations
Skip to content Login Help New Search Home Research Our Services About Us MyLibrary (More Searches) Advanced Keyword Title Author Subject Call ...

ASUS Transformer Prime Review
The ASUS Transformer Prime was the first quad-core Android tablet on the market and we've had quite a bit of time to play around with it. We'll ...

SciVerse - HUB - Home
Hub ScienceDirect Scopus Applications ???com.elsevier.hub.link.dashboard.label??? - My Settings - ???com.elsevier.hub.link.myLibrary.label??? ...

Non-ASUS tablets ask: Where is my Android 4.0 ICS?
... Android 4.0 build released just months ago. Many extra bits have been added as well, including an update to the ASUS Vibe app and myCloud MyLibrary. ...

Starter Kit: How to Outfit Your iPad Like an Ivy League Scholar
The elite college places a variety of educational, media, and social apps on its collection of iPads.

Resources last updated: 12/3/2015 5:24:34 PM