Link to home
Create AccountLog in
Avatar of mathieu_cupryk
mathieu_cuprykFlag 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

Avatar of Ted Bouskill
Ted Bouskill
Flag of Canada image

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

ASKER

This is all nice but does not help me.
It is your only choice based on the XML snippet you showed me.  I gave you the correct answer.
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
Avatar of Ted Bouskill
Ted Bouskill
Flag of Canada image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
oh man forget it.
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.