WCF service host cannot find any service metadata

后端 未结 10 559
余生分开走
余生分开走 2020-12-16 13:01

I\'m just learning wcf and currently got this far.

CS File:

using System;
using System.Collections.Generic;
using System.Linq;
using         


        
相关标签:
10条回答
  • 2020-12-16 13:23

    I got this exact same issue and was vigorously going through my configuration and everything was inline with the metadata endpoints, etc. The issue? This line:

    <service behaviorConfiguration="wcfLib.Service1Behavior" name="wcfLib.Service1">
    

    The name value MUST, MUST have the name of the physical class that is implementing the contract. I forgot... once again and arbitrarily named it thinking it could be any string. So in the case above the implementing class must be named Service1. If the class name changes, make sure to change this value.

    This is like WCF 101 stuff and I still get burnt by it even though I have been doing WCF since CTP in Framework 3.0. Blah...

    0 讨论(0)
  • 2020-12-16 13:30

    The easiest way to create this problem is to simply re-factor your interface name. It certainly changes the instance name across your project but it fails to update the web.config file. To recreate create a new service, rename your interface and whack F5, boom, metadata dialog appears :-) The answer is as above, just remember to alter your web.config file manually.

    Regards

    0 讨论(0)
  • 2020-12-16 13:31

    I had HTTP Activation turned ON. Make sure you have it on.

    Ensure HTTP Activation is on

    0 讨论(0)
  • 2020-12-16 13:33

    I know this an old question but I thought I'd give my 2 cents on the subject since it just happened to me.

    I somehow changed my Build Platform from "Any CPU" to "x86" for the web service itself. The second I changed it back to "Any CPU", it resolved the problem.

    0 讨论(0)
提交回复
热议问题