Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9081635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:21:42+00:00 2026-06-16T20:21:42+00:00

I have a value called appName, defined in the app config that stores the

  • 0

I have a value called appName, defined in the app config that stores the name of an application. The application writes logs to a database via a Database Trace Listener. What I am trying to do is have the application take it’s appName value and set the defaultCategory to have that same value at runtime. I assume I also have to rename the existing category to appName’s value as well. I don’t want to affect anything other than the name of that category and the change to the defaultCategory (to the renamed one).

Here’s the config section, TESTING is the value I want to change at runtime:

<loggingConfiguration name="" tracingEnabled="true" defaultCategory="TESTING">

...

<categorySources>

 ...

 <add switchValue="All" name="TESTING">
  <listeners>
    <add name="Database Trace Listener" />
  </listeners>
 </add>
</categorySources> 

I’ve tried looking up a solution/example but to closest thing I found re-wrote the whole section and I’d rather avoid that.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T20:21:44+00:00Added an answer on June 16, 2026 at 8:21 pm

    Enterprise Library supports run-time programmatic configuration or design-time declarative configuration for a single application block. But out of the box you can’t really mix the two approaches easily for the same application block.

    You mention one approach which is to modify the configuration and write it back.

    Another approach would be to set all configuration programmatically at runtime.

    An alternative which can work if you use an external configuration file (e.g. FileConfigurationSource in app.config/web.config that points to the actual Enterprise Library configuration) is to load the configuration information and then modify it in memory. The reason to use an external configuration file is to avoid a readonly configuration exception when trying to modify the configuration information.

    That last approach is laid out in the article Enterprise Library Programmatic Configuration.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Have a database called 'lms' with two tables loan and value, table loan
I have a value called 'AmountWrongGuessed' that gives the amount of wrong guesses the
I have some documents in CouchDB that contains a value called expire. e.g.: expire:
I would just like your feedback on something. Basically I have a value called
I have a value int called score and i want to save this to
I have a class with a Property called 'Value' which is of type Object.
I have a value in my MS SQL table column called XDATA like this:
I have given a default value 2.5 for a textbox called diff_Box and then
I have a column called menu_order which has no default value. When I select
I have the following method which is called when the value Edit Class... is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.