none
ServiceModel configuration in shared .net dll - best practices RRS feed

  • Question

  • Hi
    I was hoping someone could help with a .net dll configuration issue. I have developed a com visible .net dll that will be shared by a number of applications written .net and vb6. The dll accesses several web services and I would like to not to have to supply serviceModel configuration for each every application that references the this dll. Every attempt I have tried to separate the dll config from the calling app has simply by-passed the dll app.config. Could some tell me what is What is best practice for a shared configuration that will not be ignored at run time.

    thanks in Advance

    AW
    Friday, January 6, 2017 8:52 PM

All replies

  • Configuration belongs to the hosting application, not the .dll.  To configure a COM component hosted by a VB6 application for WCF, I would do the configuration in code.  Then require the host program to provide the configuration values (probably just an endpoint URI), or read them yourself from some known location.

    Here's an example from SSIS, which is a similar scenario.

    How to Configure an SSIS Package to Access a Web Service using WCF

    David


    Microsoft Technology Center - Dallas

    My Blog




    Friday, January 6, 2017 9:21 PM
  • Hi Andrew Wellins,

    Thank you for posting here.

    According to your question is more related to WCF, I will move it to Windows Communication Foundation, Serialization, and Networking forum for suitable support.

    The Visual C# discuss and ask the C# programming language, IDE, libraries, samples and tools.

    If you have some grammar or code errors, please feel free to contact us. We will try our best to give you a solution.

    Thanks for your understanding and cooperation.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 9, 2017 7:33 AM
  • Hi AW,

    Have your issue been resolved? If not, please feel free to let us know. If you have, I would suggest you mark the helpful reply as answer.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, January 19, 2017 6:04 AM