System.Configuration does not support config files for libraries.

B

Bill McCormick

<!-- When deploying the service library project, the content of the
config file must be added to the host's app.config file.
System.Configuration 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.
 
N

Nicholas Paldino [.NET/C# MVP]

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).
 
B

Bill McCormick

Nicholas said:
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.
 
S

Steven Cheng

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/archive/2007/05/09/type-sharing-in-wcf-servic
e-reference.aspx

#Sharing WCF Collection Types between Service and Client
http://www.codeproject.com/KB/WCF/WCFCollectionTypeSharing.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: (e-mail address removed).

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

http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#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/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
 
B

Bill McCormick

Steven said:
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/archive/2007/05/09/type-sharing-in-wcf-servic
e-reference.aspx

#Sharing WCF Collection Types between Service and Client
http://www.codeproject.com/KB/WCF/WCFCollectionTypeSharing.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: (e-mail address removed).

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

http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#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/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
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
 
S

Steven Cheng

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: (e-mail address removed).

--------------------
 
B

Bill McCormick

Steven said:
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
 
S

Steven Cheng

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
http://geeks.netindonesia.net/blogs/kasim.wirama/archive/2007/12/11/connect-
to-wcf-service-without-proxy.aspx

http://www.clariusconsulting.net/blogs/pga/archive/2006/08/07/639.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: (e-mail address removed).


--------------------
 
B

Bill McCormick

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top