WCF service host cannot find any service metadata

后端 未结 10 581
余生分开走
余生分开走 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:09

    You need to have the following in your config file:

    1) a service behavior for metadata:

    
      
          
            
         
      
    
    

    2) reference that service behavior in your service's config

    
         ....
    
    

    *The name value in the service tags in the config file must have the same name as the physical class that is implementing the contract. Remember if the class name changes, make sure to change this value to match.

    3) an endpoint for MEX (metadata exchange)

    
         ....
    
        
    
    

    With all this in place, things should be just fine! :-)

提交回复
热议问题