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. Config files

Config files

Scheduled Pinned Locked Moved C#
csharpquestion
5 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.
  • C Offline
    C Offline
    CodingYoshi
    wrote on last edited by
    #1

    I have a .dll with its own config file. This .dll reads from its own config file and not from the app.config (this is what I wanted). However, when I create the installer for the application, the .exe uses the app.config file to read from, but what about the .dll? Where is the config file for the .dll stored? It is getting the values but I am curious where it is getting it from? The app is working fine but I want to change the config file for the .dll but I cannot find it.

    CodingYoshi Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07

    C D 2 Replies Last reply
    0
    • C CodingYoshi

      I have a .dll with its own config file. This .dll reads from its own config file and not from the app.config (this is what I wanted). However, when I create the installer for the application, the .exe uses the app.config file to read from, but what about the .dll? Where is the config file for the .dll stored? It is getting the values but I am curious where it is getting it from? The app is working fine but I want to change the config file for the .dll but I cannot find it.

      CodingYoshi Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Have you looked for the settings in the apps config file ? If you don't have a config file for the dll ( I always do ), then it's either using defaults, or getting them from the app config.

      Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

      1 Reply Last reply
      0
      • C CodingYoshi

        I have a .dll with its own config file. This .dll reads from its own config file and not from the app.config (this is what I wanted). However, when I create the installer for the application, the .exe uses the app.config file to read from, but what about the .dll? Where is the config file for the .dll stored? It is getting the values but I am curious where it is getting it from? The app is working fine but I want to change the config file for the .dll but I cannot find it.

        CodingYoshi Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07

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

        CodingYoshi wrote:

        I have a .dll with its own config file.

        No you don't. .DLL's do not use their own config file, even if you put on in the DLL's project. .DLL's are loaded into the processes that call them, inheriting the host process' config file, if there is one. Your code has to be explicitly written to find and load the config file your talking about. Config files are normally stored in the same folder as the .EXE using it.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        C 2 Replies Last reply
        0
        • D Dave Kreskowiak

          CodingYoshi wrote:

          I have a .dll with its own config file.

          No you don't. .DLL's do not use their own config file, even if you put on in the DLL's project. .DLL's are loaded into the processes that call them, inheriting the host process' config file, if there is one. Your code has to be explicitly written to find and load the config file your talking about. Config files are normally stored in the same folder as the .EXE using it.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          C Offline
          C Offline
          CodingYoshi
          wrote on last edited by
          #4

          Strange!! Then it should cause an exception since config setting are key value pairs. I have specified the key of the value in .dll code. The only other thing is, tomorrow, I have to reassure and see if a value with the same key exists in the app.config which will explain why no exception is thrown. Otherwise, I don't know. I agree with you, .dlls can have their own config files but they have to be read explicitly and I am reading it explicitly but I will reassure.

          CodingYoshi Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07

          1 Reply Last reply
          0
          • D Dave Kreskowiak

            CodingYoshi wrote:

            I have a .dll with its own config file.

            No you don't. .DLL's do not use their own config file, even if you put on in the DLL's project. .DLL's are loaded into the processes that call them, inheriting the host process' config file, if there is one. Your code has to be explicitly written to find and load the config file your talking about. Config files are normally stored in the same folder as the .EXE using it.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            C Offline
            C Offline
            CodingYoshi
            wrote on last edited by
            #5

            I reassured and the .dll is using its own config file. I am using [NameOfDll].Properties.Settings.Default.[keyOfValue] to access the value from the config file. I changed the config file for the .dll and during runtime it threw exception since it could not find it. So the question is, where is it reading from? I don't see a config file for the .dll on the production machine but all is fine.

            CodingYoshi Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07

            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