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 file you can use the

web admin tool to configure settings for your application. Use

the Website->Asp.Net Configuration option in Visual Studio.

A full list of settings and comments can be found in

machine.config.comments usually located in

\Windows\Microsoft.Net\Framework\v2.x\Config

-->

<
configuration>

 

<
appSettings/>

<connectionStrings>

<add name="InitialPriceReporting.Properties.Settings.ConnectionString"

connectionString="Data Source=SCWB2.wpg.cwb.ca;Persist Security Info=True;

User ID=init_price;Password=init_77day;Unicode=True" providerName="System.Data.OracleClient"/></connectionStrings>

 

<system.web>

<!--

Set compilation debug="true" to insert debugging

symbols into the compiled page. Because this

affects performance, set this value to true only

during development.

-->

<compilation debug="true">

<assemblies>

<add assembly="Microsoft.Practices.EnterpriseLibrary.Common, Version=3.1.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

<add assembly="Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

<add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

<add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>

<!--

The <authentication> section enables configuration

of the security authentication mode used by

ASP.NET to identify an incoming user.

-->

<authentication mode="Windows"/>

<identity impersonate="true" />

<customErrors mode="Off"/>

<!--

The <customErrors> section enables configuration

of what to do if/when an unhandled error occurs

during the execution of a request. Specifically,

it enables developers to configure html error pages

to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

<error statusCode="403" redirect="NoAccess.htm" />

<error statusCode="404" redirect="FileNotFound.htm" />

</customErrors>

-->

</system.web>

</configuration>

 

It is giving me grief.


Thank you!
0
macupryk
7/22/2008 8:08:00 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

1 Replies
2262 Views

Similar Articles

[PageSpeed] 46
Get it on Google Play
Get it on Apple App Store

In a winforms app, a typed Settings object is automatically created for you which runs this pretty nicely, but in an ASP.NET app, you don't have this luxury. I believe you will have to create a custom configuration section to be able to fit this into your web.config.

Here's a great article that helped me through: http://aspnet.4guysfromrolla.com/articles/032807-1.aspx

It is not easy, it is not fun. But it's great when it works :-)


If this post was useful to you, please mark it as answer. Thank you!
0
johram
7/22/2008 10:23:07 PM
Reply:

Similar Artilces:

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...

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....

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: http://www.beansoftware.com/ASP.NET-Tutorials/Mult...

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 ? 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 MSD...

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 www.mypage.com/subapplication/ It reads the web.config of www.mypage.com 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...

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...

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...

App.config/web.config
Hello!! I'm development a web application in n-tiers. The UI have a web.config, and the other tiers using app.config. The problem is that the application doesn´t recognize the app.config files. Only the web.config of the UI. For example: I try to put the connections string in a app.config in the data access, but when it runing, throws a error that says: "Database undefined". But when I put the connections strings in the web.config, it runing well. I need help!!!Alvaro HdezDeveloper To use xml atributes from WebConfig and AppConfig u must add referance to System...

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". ...

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...

Customize the published web.config file in a web app
We are a team developing an ASP.Net web app. We are facing the following situation: each development machine needs a slightly different web.config file. For example,each local developer machine.the continuous integration server.the open sandbox website.the production website.How do I customize the published web.config (through MSBuild for ex.). Does anyone has an idea on the matter? Thanks in advance,Joanneshttp://www.lokad.com   One possible solution is: - select one Web.Config (I usualy select development one) as a starting point - create XSLT files for any other Web.Con...

Using multiple web.configs with different web apps in the same web folder.
How do I tell a web application to use a specific web.config file instead of referencing the root web apps web.config file? Example: In IIS i have this setup:My Server  Web Sites     Default Web Site (this has web.config with a reference to a HTTP Handler)     My Http Handler           My Sub Web             < --- This sub web is looking for the http handler in this web hope that makes sense.   shawn use location elem...

Web App connecting to database using web.config file
I am using the web.config file to store my database connection string. Everything was working fine when I was running to applicaiton on my local machine. However, when I deployed to the web I keep on getting this error: System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) at System.Data.SqlClient.SqlConnection.Open() at Dev_verI.Basi...

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...

Web resources about - Need to put this in a web.config file. Transfer a collection from app.config to web.config. - asp.net.web-forms

Brogdale Farm - home of the National Fruit Collection - a great day out in Kent
Brogdale Farm, home of the National Fruit Collection Kent tourist attraction. A great day out for all the family with local produce, healthy ...

National Fruit Collection
The is one of the largest fruit collections in the world and includes over 3,500 named Apple, Pear, Plum, Cherry, Bush fruit, Vine and Cob Nut ...

Collection (museum) - Wikipedia, the free encyclopedia
A museum is distinguished by a collection of often unique objects that forms the core of its activities for exhibitions , education , research ...

Meet the biodiesel scam artist with a $15M art collection
Filed under: Government/Legal , Green , Read This , Auctions , Biodiesel The $15-million collection of confiscated art from a biodiesel fraudster ...

Should we Expect Triple-A titles in the PS Plus Instant Game Collection in January 2016?
Bidness Etc asks whether January will be the month when we can see a free triple-A offering on the PS4 for PS Plus subscribers.

"The 2015 Black List, a collection of Hollywood's best unproduced screenplays, was announced Monday..." ...
" Bubbles , by Isaac Adamson, topped the list with 44 votes. It centers on a baby chimp that’s adopted by Michael Jackson." Narrating his own ...

Lender EZCORP Must Pay $10M In Refunds, Fines For Illegal In-Person Debt Collection Practices
A small-dollar lender has been slammed with a top-dollar penalty by federal regulators who say that the company’s debt collection practices violated ...

Hearing On CFPB Bulk Data Collection Raises Consumer Safety Concerns
'The Bureau is free to do whatever it wants within the broadest imaginable interpretation of its authority'

Have a quick look at the Mega Man Legacy Collection 3DS themes
Mega Man Legacy Collection is just around the corner on 3DS. Although it was released on PS4, Xbox One, and PC earlier this year, it's still ...

Ferragamo Unveils Colorful Collection Of Fashion Watches
The collection was launched December 9 in New York during Ferragamo’s celebration of its 100-year relationship with the movie industry attended ...

Resources last updated: 12/22/2015 10:08:31 PM