Re: App.Config file

Tech-Archive recommends: Fix windows errors by optimizing your registry



Yes it does,
Thanks a lot
Stephen

"KJ" <n_o_s_p_a__m@xxxxxxxx> wrote in message
news:1137539048.647196.246320@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> I can't answer for ASP.NET 2.0. But for ASP.NET 1.1, you can define
> custom sections in the config file, then, pass in the custom section
> name to your method, and pluck the value from the appropriate section.
>
> So, your web.config might look like this (definition of the custom
> sections, followed by custom sections):
>
> <configuration>
> <configSections>
> <section
> name="dev" type="System.Configuration.NameValueFileSectionHandler,
> System, Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089"/>
> <section
> name="stage" type="System.Configuration.NameValueFileSectionHandler,
> System, Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089"/>
> <section
> name="prod" type="System.Configuration.NameValueFileSectionHandler,
> System, Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089"/>
> </configSections>
>
> <dev>
> <add key="AppRootDir" value="/Authoring/"/>
> </dev>
>
> <stage>
> <add key="AppRootDir" value="/S-Authoring/"/>
> </stage>
>
> <prod>
> <add key="AppRootDir" value="/P-Authoring/"/>
> </prod>
> </configuration>
>
> Then, write a class that retrives the values by section, using a call
> such as:
>
> NameValueCollection nvc =
> (NameValueCollection)ConfigurationSettings.GetConfig("dev");
>
> -- then return the value you want:
>
> string AppRootDir = nvc["AppRootDir"]; //returns "/Authoring/"
>
> -Hope this helps
>


.



Relevant Pages

  • Re: Windows Service config file
    ... You can also use configuration file to set the custom error mode. ... //here SimpleRemotingSln.ServerApp.exe is my server appliation's exe file ... But this doesn't answer the question whether you are using a Config file ... your remoting service. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: RemotingException.
    ... visa.dps.ppc.PPCRemotingTests.TestPPCLogin: Remoting exception - Server ... > 2) Write a custom channel sink that overrides the custom errors header in ... > the IMessage so the formatter sink will not generate custom errors. ... > element in a trivial config file. ...
    (microsoft.public.dotnet.framework.remoting)
  • RE: Help with search service using web part "The request failed with H
    ... Have you checked the trust level in the Web.Config file. ... create your own custom config file for CAS. ...
    (microsoft.public.sharepoint.portalserver.development)
  • RE: Custom Pipeline Component Config File?
    ... My BTSNtSvc.exe.config file contains the following configuration settings: ... My current workaround for this is setting a property on the custom component ... property changes. ... > Can a custom pipeline component use a config file? ...
    (microsoft.public.biztalk.general)
  • NewInspecor event wont fire when accessing config file
    ... in the event handler I'm accessing a config file (I ... I'm using Outlook 2003 win 2003. ... object addInInst, ref System.Array custom) ... (Extensibility.ext_DisconnectMode disconnectMode, ref ...
    (microsoft.public.outlook.program_addins)