views:

260

answers:

1

I have .NET Remoting setup for a number of objects. It has been production for over a year and all is well with the setup. I've added a Service Reference today in a project called Entities. One of the classes with the Entities project calls this new Service Reference. The Entities project is class library.

When I created Service Reference I noticed it created a file called "app.config" in the project root. It also created a file in the bin directory called [namespace].Entities.dll.config.

We have a test console application that we call these classes through normal references (opposed to using remoting), this allows us to easily step through for debugging. Initially when I tried to run the test console it errored with the "Could not find default endpoint element that references contract." I resolved this error by adding the app.config from Entities project root to the root of the console application.

When I went to try it in the Remoting setup, I received the same "Could not find default endpoint element that references contract" error. Unfortunately I haven't been able to figure out where to put the <system.serviceModel> config information.

I have tried the following without success:

  1. Add the information from app.conifg to the .NET Remoting web.config
  2. Add the app.config file to the root along with web.config
  3. Add the [namespace].Entities.dll.config file to the root along with web.config
  4. Add the app.config file to the bin folder root
  5. Add the [namespace].Entities.dll.config file to the bin folder root

Any other suggestions where the configuration should be put to resolve this error?

A: 

You need to have the endpoint for the client defined in the test application's app.config. This means your config file should contain something like this:

<system.serviceModel>
  <client>
    <endpoint address="[your URL]" binding="[your binding]" 
              contract="[your contract interface]"/>
  </client>
</system.serviceModel>

I'm guessing from the error message that you either don't have a client endpoint defined or that the contract attribute doesn't match up with a recognized type. You should post your system.serviceModel configuration fragment so we can more-easily help you.

Jacob
Due to a time crunch, I went a Web Service referernce instead. I did have the format above, but the Remoting application could not find the endpoint.
Josh