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.

8 comments:

  1. Common man Yoy are doing http binding !!! why then Tcp call??
    svcutil /language:cs /out:generatedproxy.cs /config:app.config http://laura.ro.umt.local:32843/3b9d470127ed48b8beef12fe838643e4/cost/Events.svc

    follow the url to configure http://www.fewlines4biju.com/2011/08/host-wcf-service-in-windows-service-in.html

    ReplyDelete
  2. svcutil /language:cs /out:generatedproxy.cs /config:app.config net.tcp://
    102.168.2.111:8732/Design_Time_Addresses/Fewlines4Biju/Events1

    Try this else send me ur app.config details, needs to check settings for the net tcp protocol.

    ReplyDelete
  3. i 've tried with localhost and IP but it doesn't work
    If i want to access through my IP address like this:
    svcutil /language:cs /out:generatedproxy.cs /config:app.config net.tcp://
    102.168.2.111/Design_Time_Addresses/Fewlines4Biju/Events1
    i get this:

    Error: An error occurred in the tool

    and the second one

    Error:The given path's format is not supported

    and i have no idea how to resolve it

    ReplyDelete
  4. If it is your local host then it will be like
    svcutil /language:cs /out:generatedproxy.cs /config:app.config net.tcp://
    localhost/Design_Time_Addresses/Fewlines4Biju/Service1

    If you want to access through your IP address then it will be like
    svcutil /language:cs /out:generatedproxy.cs /config:app.config net.tcp://
    19.122.45.67/Design_Time_Addresses/Fewlines4Biju/Service1

    Reply me if you have any doubt.

    ReplyDelete
  5. svcutil /language:cs /out:generatedproxy.cs /config:app.config net.tcp://
    [URL]/Design_Time_Addresses/Fewlines4Biju/Service1

    can you tel me l please [URL] how did you replace it , how it looks like ?

    ReplyDelete