System.Configuration does not support config files for libraries.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bill McCormick

    System.Configuration does not support config files for libraries.

    <!-- When deploying the service library project, the content of the
    config file must be added to the host's app.config file.
    System.Configur ation does not support config files for libraries. -->

    I assume "libraries" here to mean DLL's. If that's the case, is there
    any way to supply both ends of a service (client and host) with the code
    for the class that describes the contact WITHOUT a duplication in
    source code?

    Thanks.
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: System.Configur ation does not support config files for libraries.

    Bill,

    I assume you are referring to WCF given the nature of your previous
    post.

    Assuming that, you are confusing the config file (which is just an XML
    file with config info) with the assembly itself (the DLL). You can easily
    distribute a DLL to both sides (client and server). It's the config file
    you can't share (well, in WCF's case, you actually could assuming you had no
    clients in the service, and no other services in the client).

    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Bill McCormick" <wpmccormick@ne wsgroup.nospamw rote in message
    news:egIE%23lVQ JHA.1164@TK2MSF TNGP03.phx.gbl. ..
    <!-- When deploying the service library project, the content of the
    config file must be added to the host's app.config file.
    System.Configur ation does not support config files for libraries. -->
    >
    I assume "libraries" here to mean DLL's. If that's the case, is there
    any way to supply both ends of a service (client and host) with the code
    for the class that describes the contact WITHOUT a duplication in
    source code?
    >
    Thanks.

    Comment

    • Bill McCormick

      #3
      Re: System.Configur ation does not support config files for libraries.

      Nicholas Paldino [.NET/C# MVP] wrote:
      Bill,
      >
      I assume you are referring to WCF given the nature of your previous
      post.
      >
      Assuming that, you are confusing the config file (which is just an
      XML file with config info) with the assembly itself (the DLL). You can
      easily distribute a DLL to both sides (client and server). It's the
      config file you can't share (well, in WCF's case, you actually could
      assuming you had no clients in the service, and no other services in the
      client).
      >
      Well, I'm referring to WCF in general. Thanks you.

      Comment

      • Steven Cheng

        #4
        Re: System.Configur ation does not support config files for libraries.

        Hi Bill,

        Seems what you want to do is sharing some custom classes/types (defined in
        a class library) between the WCF service and client application. For WCF
        there is type sharing support. Here are two artifcles which has mentioned
        some information on this;

        #Type sharing in WCF service reference

        e-reference.aspx

        #Sharing WCF Collection Types between Service and Client


        Sincerely,

        Steven Cheng

        Microsoft MSDN Online Support Lead


        Delighting our customers is our #1 priority. We welcome your comments and
        suggestions about how we

        can improve the support we provide to you. Please feel free to let my
        manager know what you think of

        the level of service provided. You can send feedback directly to my manager
        at: msdnmg@microsof t.com.

        =============== =============== =============== =====
        Get notification to my posts through email? Please refer to

        http://msdn.microsoft.com/en-us/subs...#notifications.

        Note: MSDN Managed Newsgroup support offering is for non-urgent issues
        where an initial response from

        the community or a Microsoft Support Engineer within 2 business day is
        acceptable. Please note that

        each follow up response may take approximately 2 business days as the
        support professional working

        with you may need further investigation to reach the most efficient
        resolution. The offering is not

        appropriate for situations that require urgent, real-time or phone-based
        interactions. Issues of this

        nature are best handled working with a dedicated Microsoft Support Engineer
        by contacting Microsoft

        Customer Support Services (CSS) at

        =============== =============== =============== =====
        This posting is provided "AS IS" with no warranties, and confers no rights.


        --------------------
        >From: Bill McCormick <wpmccormick@ne wsgroup.nospam>
        >User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
        >MIME-Version: 1.0
        >Subject: Re: System.Configur ation does not support config files for
        libraries.
        >References: <egIE#lVQJHA.11 64@TK2MSFTNGP03 .phx.gbl>
        <237DB42A-89A4-47D2-84D9-26B664781AF3@mi crosoft.com>
        >
        >Nicholas Paldino [.NET/C# MVP] wrote:
        >Bill,
        >>
        > I assume you are referring to WCF given the nature of your previous
        >post.
        >>
        > Assuming that, you are confusing the config file (which is just an
        >XML file with config info) with the assembly itself (the DLL). You can
        >easily distribute a DLL to both sides (client and server). It's the
        >config file you can't share (well, in WCF's case, you actually could
        >assuming you had no clients in the service, and no other services in the
        >client).
        >>
        >Well, I'm referring to WCF in general. Thanks you.
        >

        Comment

        • Bill McCormick

          #5
          Re: System.Configur ation does not support config files for libraries.

          Steven Cheng wrote:
          Hi Bill,
          >
          Seems what you want to do is sharing some custom classes/types (defined in
          a class library) between the WCF service and client application. For WCF
          there is type sharing support. Here are two artifcles which has mentioned
          some information on this;
          >
          #Type sharing in WCF service reference

          e-reference.aspx
          >
          #Sharing WCF Collection Types between Service and Client

          >
          Sincerely,
          >
          Steven Cheng
          >
          Microsoft MSDN Online Support Lead
          >
          >
          Delighting our customers is our #1 priority. We welcome your comments and
          suggestions about how we
          >
          can improve the support we provide to you. Please feel free to let my
          manager know what you think of
          >
          the level of service provided. You can send feedback directly to my manager
          at: msdnmg@microsof t.com.
          >
          =============== =============== =============== =====
          Get notification to my posts through email? Please refer to
          >
          http://msdn.microsoft.com/en-us/subs...#notifications.
          >
          Note: MSDN Managed Newsgroup support offering is for non-urgent issues
          where an initial response from
          >
          the community or a Microsoft Support Engineer within 2 business day is
          acceptable. Please note that
          >
          each follow up response may take approximately 2 business days as the
          support professional working
          >
          with you may need further investigation to reach the most efficient
          resolution. The offering is not
          >
          appropriate for situations that require urgent, real-time or phone-based
          interactions. Issues of this
          >
          nature are best handled working with a dedicated Microsoft Support Engineer
          by contacting Microsoft
          >
          Customer Support Services (CSS) at

          =============== =============== =============== =====
          This posting is provided "AS IS" with no warranties, and confers no rights.
          >
          >
          --------------------
          >From: Bill McCormick <wpmccormick@ne wsgroup.nospam>
          >User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
          >MIME-Version: 1.0
          >Subject: Re: System.Configur ation does not support config files for
          libraries.
          >References: <egIE#lVQJHA.11 64@TK2MSFTNGP03 .phx.gbl>
          <237DB42A-89A4-47D2-84D9-26B664781AF3@mi crosoft.com>
          >
          >Nicholas Paldino [.NET/C# MVP] wrote:
          >>Bill,
          >>>
          >> I assume you are referring to WCF given the nature of your previous
          >>post.
          >>>
          >> Assuming that, you are confusing the config file (which is just an
          >>XML file with config info) with the assembly itself (the DLL). You can
          >>easily distribute a DLL to both sides (client and server). It's the
          >>config file you can't share (well, in WCF's case, you actually could
          >>assuming you had no clients in the service, and no other services in the
          >>client).
          >>>
          >Well, I'm referring to WCF in general. Thanks you.
          >>
          >
          Thanks Steven. I think that is indeed for what I'm looking. However, I
          expected this to be a little more trivial that it appears to be.

          I guess I'm now left with two nagging questions:

          1. Why is type sharing frowned upon?

          2. How can a client app be written, using intellisense, without type
          sharing?


          Thanks,

          Bill

          Comment

          • Steven Cheng

            #6
            Re: System.Configur ation does not support config files for libraries.

            Thanks for your reply Bill,

            As for the sharing type functionality, it is done by the WCF client proxy
            generation process. As mentioned in the articles, the command svcutil.exe
            can help do it via a command line option. While in Visual studio IDE, when
            "Add service reference", you can click "Advanced" button to find the
            sharing type option. So far this is the most interactive friendly means I
            have found.

            Sincerely,

            Steven Cheng

            Microsoft MSDN Online Support Lead


            Delighting our customers is our #1 priority. We welcome your comments and
            suggestions about how we

            can improve the support we provide to you. Please feel free to let my
            manager know what you think of

            the level of service provided. You can send feedback directly to my manager
            at: msdnmg@microsof t.com.

            --------------------
            >From: Bill McCormick <wpmccormick@ne wsgroup.nospam>
            >User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
            >MIME-Version: 1.0
            >To: Steven Cheng <stcheng@online .microsoft.com>
            >Subject: Re: System.Configur ation does not support config files for
            libraries.
            >
            >Steven Cheng wrote:
            >Hi Bill,
            >>
            >Seems what you want to do is sharing some custom classes/types (defined
            in
            >a class library) between the WCF service and client application. For WCF
            >there is type sharing support. Here are two artifcles which has
            mentioned
            >some information on this;
            >>
            >#Type sharing in WCF service reference
            >>
            http://blogs.msdn.com/lifenglu/archi...-in-wcf-servic
            >e-reference.aspx
            >>
            >#Sharing WCF Collection Types between Service and Client
            >http://www.codeproject.com/KB/WCF/WC...peSharing.aspx
            >>
            >Sincerely,
            >>
            >Steven Cheng
            >>
            >Microsoft MSDN Online Support Lead
            >>
            >>
            >Delighting our customers is our #1 priority. We welcome your comments
            and
            >suggestions about how we
            >>
            >can improve the support we provide to you. Please feel free to let my
            >manager know what you think of
            >>
            >the level of service provided. You can send feedback directly to my
            manager
            >at: msdnmg@microsof t.com.
            >>
            >============== =============== =============== ======
            >Get notification to my posts through email? Please refer to
            >>
            >>
            http://msdn.microsoft.com/en-us/subs...#notifications.
            >>
            >Note: MSDN Managed Newsgroup support offering is for non-urgent issues
            >where an initial response from
            >>
            >the community or a Microsoft Support Engineer within 2 business day is
            >acceptable. Please note that
            >>
            >each follow up response may take approximately 2 business days as the
            >support professional working
            >>
            >with you may need further investigation to reach the most efficient
            >resolution. The offering is not
            >>
            >appropriate for situations that require urgent, real-time or phone-based
            >interactions . Issues of this
            >>
            >nature are best handled working with a dedicated Microsoft Support
            Engineer
            >by contacting Microsoft
            >>
            >Customer Support Services (CSS) at
            >http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
            >============== =============== =============== ======
            >This posting is provided "AS IS" with no warranties, and confers no
            rights.
            >>

            Comment

            • Bill McCormick

              #7
              Re: System.Configur ation does not support config files for libraries.

              Steven Cheng wrote:
              Thanks for your reply Bill,
              >
              As for the sharing type functionality, it is done by the WCF client proxy
              generation process. As mentioned in the articles, the command svcutil.exe
              can help do it via a command line option. While in Visual studio IDE, when
              "Add service reference", you can click "Advanced" button to find the
              sharing type option. So far this is the most interactive friendly means I
              have found.
              >
              Sincerely,
              >
              Steven Cheng
              >
              Microsoft MSDN Online Support Lead
              Thanks Steven, but I'm not sure if that really answers my questions:

              1. What is the *argument* against type sharing?

              2. What are the *alternatives* to type sharing?

              However, I am happy to know that there's a "pointy-clicky" way to
              generate a client proxy. But that leads me to an extension of my 2nd
              question:

              2a. Is a "client proxy" strictly required for type sharing?


              Bill

              Comment

              • Steven Cheng

                #8
                Re: System.Configur ation does not support config files for libraries.

                Thanks for your reply Bill,

                As you mentioned in first message that you want to reuse the same set of
                custom classes(will be used as parameter or return value of WCF service
                operation), then I suggest you the "sharing type" feature of WCF. That's
                the means which can help you make the client generated WCF proxy reference
                the existing classes (in the specified assembly) instead generate a new
                copy of delegate classes.

                For WCF service, using "client proxy" is the most convenient means to
                consume service methods. If you do not use them, you'll need to manually
                write the code to call the WCF service(is this what you want?).

                #Connect to WCF Service Without Proxy

                to-wcf-service-without-proxy.aspx



                For that case, I think you can try directly use the shared classes in class
                library assembly directly(since there is no pregenerated proxy classes).

                Sincerely,

                Steven Cheng

                Microsoft MSDN Online Support Lead


                Delighting our customers is our #1 priority. We welcome your comments and
                suggestions about how we

                can improve the support we provide to you. Please feel free to let my
                manager know what you think of

                the level of service provided. You can send feedback directly to my manager
                at: msdnmg@microsof t.com.


                --------------------
                >From: Bill McCormick <wpmccormick@ne wsgroup.nospam>
                >To: Steven Cheng <stcheng@online .microsoft.com>
                >Subject: Re: System.Configur ation does not support config files for
                libraries.
                >
                >Steven Cheng wrote:
                >Thanks for your reply Bill,
                >>
                >As for the sharing type functionality, it is done by the WCF client
                proxy
                >generation process. As mentioned in the articles, the command
                svcutil.exe
                >can help do it via a command line option. While in Visual studio IDE,
                when
                >"Add service reference", you can click "Advanced" button to find the
                >sharing type option. So far this is the most interactive friendly means
                I
                >have found.
                >>
                >Sincerely,
                >>
                >Steven Cheng
                >>
                >Microsoft MSDN Online Support Lead
                >
                >Thanks Steven, but I'm not sure if that really answers my questions:
                >
                >1. What is the *argument* against type sharing?
                >
                >2. What are the *alternatives* to type sharing?
                >
                >However, I am happy to know that there's a "pointy-clicky" way to
                >generate a client proxy. But that leads me to an extension of my 2nd
                >question:
                >
                >2a. Is a "client proxy" strictly required for type sharing?
                >
                >
                >Bill
                >

                Comment

                • Bill McCormick

                  #9
                  Re: System.Configur ation does not support config files for libraries.

                  OK. I think it's starting to sink in. I'm going to end this thread since
                  the topic is now starting to converge with the WCF Advice thread I have
                  on going. If you would, please join me there.

                  Thanks,

                  Bill

                  Steven Cheng wrote:
                  Thanks for your reply Bill,
                  >
                  As you mentioned in first message that you want to reuse the same set of
                  custom classes(will be used as parameter or return value of WCF service
                  operation), then I suggest you the "sharing type" feature of WCF. That's
                  the means which can help you make the client generated WCF proxy reference
                  the existing classes (in the specified assembly) instead generate a new
                  copy of delegate classes.
                  >
                  For WCF service, using "client proxy" is the most convenient means to
                  consume service methods. If you do not use them, you'll need to manually
                  write the code to call the WCF service(is this what you want?).
                  >
                  #Connect to WCF Service Without Proxy

                  to-wcf-service-without-proxy.aspx
                  >

                  >
                  For that case, I think you can try directly use the shared classes in class
                  library assembly directly(since there is no pregenerated proxy classes).
                  >
                  Sincerely,
                  >
                  Steven Cheng
                  >
                  Microsoft MSDN Online Support Lead
                  >
                  >
                  Delighting our customers is our #1 priority. We welcome your comments and
                  suggestions about how we
                  >
                  can improve the support we provide to you. Please feel free to let my
                  manager know what you think of
                  >
                  the level of service provided. You can send feedback directly to my manager
                  at: msdnmg@microsof t.com.
                  >
                  >
                  --------------------
                  >From: Bill McCormick <wpmccormick@ne wsgroup.nospam>
                  >To: Steven Cheng <stcheng@online .microsoft.com>
                  >Subject: Re: System.Configur ation does not support config files for
                  libraries.
                  >
                  >Steven Cheng wrote:
                  >>Thanks for your reply Bill,
                  >>>
                  >>As for the sharing type functionality, it is done by the WCF client
                  proxy
                  >>generation process. As mentioned in the articles, the command
                  svcutil.exe
                  >>can help do it via a command line option. While in Visual studio IDE,
                  when
                  >>"Add service reference", you can click "Advanced" button to find the
                  >>sharing type option. So far this is the most interactive friendly means
                  I
                  >>have found.
                  >>>
                  >>Sincerely,
                  >>>
                  >>Steven Cheng
                  >>>
                  >>Microsoft MSDN Online Support Lead
                  >Thanks Steven, but I'm not sure if that really answers my questions:
                  >>
                  >1. What is the *argument* against type sharing?
                  >>
                  >2. What are the *alternatives* to type sharing?
                  >>
                  >However, I am happy to know that there's a "pointy-clicky" way to
                  >generate a client proxy. But that leads me to an extension of my 2nd
                  >question:
                  >>
                  >2a. Is a "client proxy" strictly required for type sharing?
                  >>
                  >>
                  >Bill
                  >>
                  >

                  Comment

                  Working...