Monday, September 19, 2011

System.InvalidOperationException: Could not find default endpoint element that references contract 'IService' 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

I got this error "System.InvalidOperationException: Could not find default endpoint element that references contract 'IService' 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" while trying to generate the proxy class using gacutil.exe.

And to command is:
svcutil /language:cs /out:generatedproxy.cs /config:app.config net.tcp://
[URL]/Design_Time_Addresses/Fewlines4Biju/Service1
Remember you have to go to Visual Studio 2010 command prompt and type this.
There are lot of solutions available to change the App.config file in WCF. But what I have done is simply funny. I have not given the proper URL. and once i have given the proper url that works for me and it generates the proxy class.
You can check more wcf articles.