Avatar of mathieu_cupryk
mathieu_cupryk
Flag for Canada asked on

I need to add this in a webconfig it was in an app.config.

where should I put it and what should I rename the tags if I have to
<!--<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>-->
<?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=UCWB2.wpg.cwb.ca;Persist Security Info=True;
         User ID=init_price;Password=init_77day;Unicode=True" providerName="System.Data.OracleClient"/>
   
  </connectionStrings>
 
  <!--<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>-->
	<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>

Open in new window

.NET ProgrammingASP.NET

Avatar of undefined
Last Comment
Ted Bouskill

8/22/2022 - Mon
Ted Bouskill

You have to create a custom configuration section in the web.config.  http://support.microsoft.com/kb/309045
mathieu_cupryk

ASKER
This is all nice but does not help me.
Ted Bouskill

It is your only choice based on the XML snippet you showed me.  I gave you the correct answer.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
mathieu_cupryk

ASKER
How do I add it to the 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=UCWB2.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"/>
   
      </system.web>
</configuration>
ASKER CERTIFIED SOLUTION
Ted Bouskill

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
mathieu_cupryk

ASKER
oh man forget it.
Ted Bouskill

I'm not sure why you don't understand.  If you insert that XML into the web.config the web application will crash.  The web.config has a specialized layout.  To add custom XML like what you specified you MUST use the technique I gave you.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.