tags:

views:

88

answers:

1

On my dev box I have a solution with 6 projects. It is a WCF(3 proj) and multiple biz projects (other 3).

When I copy the core WCF folder, it's bin and web.config I get an error message on the server saying that it cannot find the contract that is stated in the app.config section of the biz app with an app.config.

Where should I put this app.config? I tried to add the node to the web config but no go there.

+1  A: 

If you're trying to host that services into a web application, you'll need to merge manually that individual app.config files (one for each WCF project) into your web.config file, under <system.serviceModel> section.

EDIT: You'll need something like this into your host configuration (web project?)

<system.serviceModel>
  <services>
    <service name="YourCompany.YourProject.YourService"
       behaviorConfiguration="YourBehaviorConfiguration">
      <endpoint address=""
                binding="wsHttpContextBinding"
                contract="YourCompany.YourProject.IYourService" />
      <endpoint address="mex"
                binding="mexHttpBinding"
                contract="IMetadataExchange" />
    </service>
  </services>

  <behaviors>
    <serviceBehaviors>
      <behavior name="YourBehaviorConfiguration">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="true" />
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>
Rubens Farias
I had already had that, see above. Sorry I hit the wrong add comments section.
SteveO
I read your example and agree that is needed to PRESENT from the WCF to the outside.My problem is a pointer to another WS written in java by my business class that will NOT EXPOSE this java evnvironment's identity.So I believe that I need inside the <system.servicemodel> a <client><endpoint ...../></client>Which I have. In the binding section I include that custom binding.I have only one serviceBehavior much like yours.
SteveO
where that java app came from? =)can you please to edit your question to provide more detail?
Rubens Farias
I went and looked at the WCF web.config and it was different from my apps? I replaced bad with working and poof it works as expected.Thanks for the replies.
SteveO