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. C#
  4. user control + app.config

user control + app.config

Scheduled Pinned Locked Moved C#
question
3 Posts 2 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.
  • F Offline
    F Offline
    FernandoMartin
    wrote on last edited by
    #1

    Hi, i've created a user control and it must read an app.config, but it doesn't work. The user control can'f find the app.config file. how I do to user control find thee app.config file? thank you.

    D 1 Reply Last reply
    0
    • F FernandoMartin

      Hi, i've created a user control and it must read an app.config, but it doesn't work. The user control can'f find the app.config file. how I do to user control find thee app.config file? thank you.

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

      Controls and .DLL's don't get their own configuration files. As the name suggests, they're Application configuration files, not component. You're control will have to rely on the developer supplying the configuration in his/her application's app.config file if you want to use the .NET Frameworks built-in classes and methods for retrieving config options. The only way to supply a seperate config file for your component (not a good idea BTW!), is to implement your own config file (preferrably in XML,) specifying your own schema and writing the code to find and load the config file yourself.

      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      F 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Controls and .DLL's don't get their own configuration files. As the name suggests, they're Application configuration files, not component. You're control will have to rely on the developer supplying the configuration in his/her application's app.config file if you want to use the .NET Frameworks built-in classes and methods for retrieving config options. The only way to supply a seperate config file for your component (not a good idea BTW!), is to implement your own config file (preferrably in XML,) specifying your own schema and writing the code to find and load the config file yourself.

        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        F Offline
        F Offline
        FernandoMartin
        wrote on last edited by
        #3

        is it possible the dll read the app.config file of the application?

        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