.net 4.0
I have two web projects using their own web.config
file and using the same endpoints to call the same WCF web service.
Both use a common project (dll) which has an app.config
file. I would like to move the endpoint info into that config file - is this possible? I want endpoint information
<client>
<endpoint/>
<client/>
to be shared by both web app from common place?
Web.config
file binding info omitted here
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings/>
<client configSource="client.config">
<system.serviceModel/>
</configuration>
client.config
file within common project
<client>
<endpoint
name="endpoint1"
address="http://localhost/ServiceModelSamples/service.svc"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IHello"
behaviorConfiguration="IHello_Behavior"
contract="IHello"/ >
Apology for typo two things i changed 1. client.config had a element took that out. 2. within the build properties of project added COPY "$(TargetDir)*.config" "$(ProjectDir)"
Just to mention both in web.config (configSource)& client.config VStudio shouts design time but runs fine?