Using Enterprise Library in a Library RRS feed

  • Question

  • I hae a web application project and I want to create a separate library to promote code reuse in my project, but I want to be able to use the Enterprise Library to do things like data access, validation, etc. However, I know I have to have a .config file, which my web application has, but the library doesn't.

    So, what is the correct way to use the Enterprise Library (v4.1) with a library? Do I just add the references and start developing and when the dll's referenced in my web application, it'll use the settings in the web apps web.config? I do have all of the settings already configured in the web apps web.config.
    Nathon Dalton
    Software Developer
    Systems Administrator
    Network Administrator
    Blog: http://nathondalton.wordpress.com
    Wednesday, February 24, 2010 4:10 PM


  • Just add a reference to EntLib in your class library. Every project that uses you class library will need to have a config file. You can also think about creating components / classes in you class library that can be initialized with some kind of config parameter, so you can pass the config values from the projects using your class library.
    • Marked as answer by Nathon Dalton Thursday, February 25, 2010 6:12 PM
    Wednesday, February 24, 2010 4:17 PM