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.

💬 1 Replies
👁️‍🗨️ 2262 Views



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: