当前位置:  开发笔记 > 编程语言 > 正文

配置和使用WCFExtras - WCF/C#/ VS2008

如何解决《配置和使用WCFExtras-WCF/C#/VS2008》经验,为你挑选了1个好方法。

我在StackOverflow上的另一篇文章中关注了这个链接:

WCFExtras

这是我的WCF服务库中的app.config.



  
    
  
  
  
    
      
        
          
            
          
        
        
        
          
            
          
        
      
    
    
      
        
          
        

      
      
        
          
          
          
          
        
      
    
    
      
 
        
      
    
  

我在这里删除了连接字符串部分等部分.当我尝试使用[XmlComments]运行时,它会给我一个错误:

Error: Cannot obtain Metadata from http://localhost:8731/TestClient.Service/Service1/mex
If this is a Windows (R) Communication Foundation service to which you have access,
please check that you have enabled metadata publishing at the specified address.
For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error
URI: http://localhost:8731/TestClient.Service/Service1/mex
Metadata contains a reference that cannot be resolved: 'http://localhost:8731/TestClient.Service/Service1/mex'.

  
    Receivera:InternalServiceFault
    An exception was thrown in a call to a WSDL export extension: WCFExtras.Wsdl.Documentation.XmlCommentsAttribute contract: http://tempuri.org/:ISearchService
    
      
      
      XML documentation file for TestClient.Service.dll was not found. Make sure the XML documentation option is enabled in the project properties for that assembly.
      
at WCFExtras.Utils.XmlCommentsUtils.LoadXmlComments(Type type, Boolean throwIfNotFound) in C:\sandbox\WCFExtras\WCFExtras\Utils\XmlCommentsUtils.cs:line 305
at WCFExtras.Wsdl.Documentation.XmlCommentsExporter.ExportContract(WsdlExporter exporter, WsdlContractConversionContext context, XmlCommentFormat format) in C:\sandbox\WCFExtras\WCFExtras\Wsdl\Documentation\XmlCommentsExporter.cs:line 172
at WCFExtras.Wsdl.Documentation.XmlCommentsAttribute.ExportContract(WsdlExporter exporter, WsdlContractConversionContext context) in C:\sandbox\WCFExtras\WCFExtras\Wsdl\Documentation\XmlCommentsAttribute.cs:line 45
at System.ServiceModel.Description.WsdlExporter.CallExtension(WsdlContractConversionContext contractContext, IWsdlExportExtension extension)System.ApplicationExceptionAn exception was thrown in a call to a WSDL export extension: WCFExtras.Wsdl.Documentation.XmlCommentsAttribute contract: http://tempuri.org/:ISearchService
at System.ServiceModel.Description.ServiceMetadataBehavior.MetadataExtensionInitializer.GenerateMetadata()   at System.ServiceModel.Description.ServiceMetadataExtension.EnsureInitialized()
at System.ServiceModel.Description.ServiceMetadataExtension.WSMexImpl.GatherMetadata(String dialect, String identifier)
at System.ServiceModel.Description.ServiceMetadataExtension.WSMexImpl.Get(Message request)   at SyncInvokeGet(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
    System.InvalidOperationException
HTTP GET Error
URI: http://localhost:8731/TestClient.Service/Service1/mex
There was an error downloading 'http://localhost:8731/TestClient.Service/Service1/mex'.
The request failed with HTTP status 400: Bad Request.

David Schmit.. 5

错误消息的内容就在那里:

找不到TestClient.Service.dll的XML文档文件.确保在该程序集的项目属性中启用了XML文档选项.

转到项目选项,在"构建"页面上,启用XML文档的创建.



1> David Schmit..:

错误消息的内容就在那里:

找不到TestClient.Service.dll的XML文档文件.确保在该程序集的项目属性中启用了XML文档选项.

转到项目选项,在"构建"页面上,启用XML文档的创建.

推荐阅读
有风吹过best
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有