Prash's Blog

Could not find default endpoint element that references contract in the ServiceModel client configuration section October 3, 2012

Filed under: Uncategorized — prazjain @ 2:23 pm

I get this error when testing one of my methods that makes WCF service calls, and at service invocation I get this error :

Could not find default endpoint element that references contract ‘XYZ.IMyInterface’ in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

This happens because the wcf service configuration is possibly missing from app.config file of the test project.
So add service configuration from app.config of the wcf library project and copy it to your test project.

This can also happen if WCF service is in a dll, and that dll is being invoked from another startup project, so then the config will need to be in app.config of the startup project.

Advertisements
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s