Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Does the CLR cache .config values or tracing levels?

Does the CLR cache .config values or tracing levels?

Scheduled Pinned Locked Moved .NET (Core and Framework)
dotnetwinformsquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nicknotyet
    wrote on last edited by
    #1

    It does make sense to me that it would, but when I have multiple assemblies that examine the (TraceLevelSwitch), which is configure for a different value in each assembly. However, they all seem to operate on the same value, rather than the one configured in the individual .config files. Detail: Assembly A - .dll Assembly B - .dll Assembly C - windows forms app .exe All assemblies use the following code: private static System.Diagnostics.TraceSwitch _TraceLevelSwitch = new System.Diagnostics.TraceSwitch("TraceLevelSwitch", "Tracing level"); All assemblies seem to pick up the value for Assembly C, which runs/loads first. Anyone got some insight into this?

    D 1 Reply Last reply
    0
    • N nicknotyet

      It does make sense to me that it would, but when I have multiple assemblies that examine the (TraceLevelSwitch), which is configure for a different value in each assembly. However, they all seem to operate on the same value, rather than the one configured in the individual .config files. Detail: Assembly A - .dll Assembly B - .dll Assembly C - windows forms app .exe All assemblies use the following code: private static System.Diagnostics.TraceSwitch _TraceLevelSwitch = new System.Diagnostics.TraceSwitch("TraceLevelSwitch", "Tracing level"); All assemblies seem to pick up the value for Assembly C, which runs/loads first. Anyone got some insight into this?

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      .DLL's can't have their own config files. They'll always use the .EXE's config in which their running. Dave Kreskowiak Microsoft MVP - Visual Basic

      N 1 Reply Last reply
      0
      • D Dave Kreskowiak

        .DLL's can't have their own config files. They'll always use the .EXE's config in which their running. Dave Kreskowiak Microsoft MVP - Visual Basic

        N Offline
        N Offline
        nicknotyet
        wrote on last edited by
        #3

        I was afraid of that. Perhaps I could use different explicit switches in the main app's .config? Thanks for the reply.

        R 1 Reply Last reply
        0
        • N nicknotyet

          I was afraid of that. Perhaps I could use different explicit switches in the main app's .config? Thanks for the reply.

          R Offline
          R Offline
          Rob Philpott
          wrote on last edited by
          #4

          The configuration is on the AppDomain level. If you're bonkers enough you can create a new appdomain, set its base directory/config file path etc, load your satellite assemblies in to that, and call them dynamically, but its a rubbish idea and I wish I'd never said anything now. Regards, Rob Philpott.

          N D 2 Replies Last reply
          0
          • R Rob Philpott

            The configuration is on the AppDomain level. If you're bonkers enough you can create a new appdomain, set its base directory/config file path etc, load your satellite assemblies in to that, and call them dynamically, but its a rubbish idea and I wish I'd never said anything now. Regards, Rob Philpott.

            N Offline
            N Offline
            nicknotyet
            wrote on last edited by
            #5

            No Worries. By constructing the key (value) name at run-time, based on the assembly name, I can control the behavior of each assembly individually from one .config file, which is a better solution anyway.:-D Thanks for the info.

            1 Reply Last reply
            0
            • R Rob Philpott

              The configuration is on the AppDomain level. If you're bonkers enough you can create a new appdomain, set its base directory/config file path etc, load your satellite assemblies in to that, and call them dynamically, but its a rubbish idea and I wish I'd never said anything now. Regards, Rob Philpott.

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Rob Philpott wrote:

              but its a rubbish idea and I wish I'd never said anything now.

              :laugh::laugh::laugh: Dave Kreskowiak Microsoft MVP - Visual Basic

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups