让SvcUtil工具从C#文件,拿起文件? [英] Make svcutil pick up documentation from C# files?

查看:132
本文介绍了让SvcUtil工具从C#文件,拿起文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们,

我创建一个新的WCF服务,并开始与我的服务接口。看起来是这样的:

I'm creating a new WCF Service and started with my Service interface. Looks something like:

   public interface ISomethingService
    {
        /// <summary>
        /// some description
        /// </summary>
        /// <version>2.13.0</version>
        /// <copyright>2009 by myself</copyright>
        /// <author>Marc Scheuner</author>
        /// <param name="request">The request object</param>
        [OperationContract]
        SomethingResponse GetList(SomethingRequest request);
    }

现在,我也创造了另一个文件描述SomethingRequest和SomethingResponse一些数据合同。邮件

Now, I also created some data contracts in another file describing the SomethingRequest and SomethingResponse messages.

我编译我的项目,并解雇了svcutil.exe的提取DLL中的元数据(WSDL和XSD) - 但我不能似乎如果要弄清楚有一个办法让我所有的评论和解释到WSDL / XSD到/节点。

I compiled my project and fired up svcutil.exe to extract the metadata (WSDL and XSD) from the DLL - but I can't seem to figure out if there's a way to get all my comments and explanations into the WSDL/XSD into / nodes.

我是瞎又晦涩svcutil.exe的参数,或者是真的没有办法生成的元数据自动??

Am I blind for yet another obscure svcutil.exe parameter, or is there really no way to generate this documentation in the metadata automatically??

编辑文档:好的,根据马克Gravell的答案,注释和文档字符串不是无论是在编译的DLL ,也可通过MEX元数据交换协议(!可惜了)

ok, based on Marc Gravell's answer, the comments and documentation strings aren't in either the compiled DLL, nor available over the MEX metadata exchange protocol (pity!).

这样的话:你是如何记录您的WCF服务,如果你需要给第三方的信息,他们需要访问你的服务?有没有解决,一个NService或沙堡的WCF工具会扫描我的WCF服务库,构建从源代码WSDL和XSD,包括注释??

SO THEN: How do you document your WCF services, if you need to give a third-party the information they need to access your service?? Is there a "NService" or "Sandcastle for WCF" tool around that would scan my WCF service library and construct the WSDL and XSD from source code, including the annotations??

似乎无法找到一大堆的工具和方法可以做到这一点 - 我的大惊喜,说实话......

Can't seem to find a whole lot of tools and ways to do this - to my big surprise, honestly....

马克

推荐答案

svcutil.exe的消耗MEX的API,并且只能访问的元数据的一个子集。不包括评论(也不是,IIRC,是 [DescriptionAttribute] 任何大的程度)。

svcutil.exe consumes the "mex" API, and only has access to a subset of the metadata. Comments aren't included (nor, IIRC, is [DescriptionAttribute] to any great extent).

您可能必须依靠外部文档(即帮助页/死树)。另一个选择(尽管它打破了许多纯SOA规则)是船舶在DLL + XML实体/接口; SvcUtil工具(和IDE)可重复使用的匹配从现有的组件类型。

You might have to rely on external documentation (i.e. a help page / dead tree). One other option (although it breaks a number of pure SOA rules) is to ship the entities / interfaces in a dll + xml; svcutil (and the IDE) can re-use matching types from existing assemblies.

这篇关于让SvcUtil工具从C#文件,拿起文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆