XML 注释 - 未在智能感知中显示的异常 [英] XML Comments - Exceptions not showing in intellisense

查看:23
本文介绍了XML 注释 - 未在智能感知中显示的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在命名空间下抛出异常的方法:MyApp.Domain.我在命名空间下有一些自定义异常:MyApp.Domain.Exceptions.所以我所拥有的是:

I have a method that throws an exception under the namespace: MyApp.Domain. I have some of my custom exceptions under the namespace: MyApp.Domain.Exceptions. So what I have is this:

using MyApp.Domain.Exceptions
using System;

namespace MyApp.Domain
{
    public class SomeClass
    {
        ///<summary>This method does some stuff</summary>
        ///<exception cref="MyCustomExeption">MyCustomException if x</exception>
        ///<exception cref="Exception">GenericException if y</exception>
        public void DoStuff(){

            //Does stuff

        }
    }
}

我正在使用智能感知进行总结,但没有例外.我是否必须使用包含并创建外部 xml 注释文件,因为它们位于不同的命名空间下?这两个异常都没有出现在智能感知、mycustomexception 或 system.exception 中.

I am getting my summary with intellisense but not exceptions. Do I have to use an include and create an external xml comment file since they are under different namespaces? Neither of the exceptions are showing up in intellisense, mycustomexception or system.exception.

谢谢.

推荐答案

实际上 Exception 标签将在您输入完整的方法名称然后鼠标悬停时可见.

actually the Exception tag will be visible once you type the full method name then on mouse over.

如果您想在开始输入方法名称后立即显示异常,则必须在以

and if you wanted to show exception as soon as u started typing the method name you have to provide the exception in summary tag separated by <para>

     /// <summary>
    /// this is my method for date convert        
    /// <para>Exception:</para>
    /// Exception - this will appear as soon as you started typing the method name and method over.
    /// </summary>
    /// <exception cref="Exception"></exception> 

希望它清楚你想要什么.

hope it make clear what u wanted.

在用户开始输入方法名称后立即显示您想要的任何内容.您只需在摘要标签内提供.

to show the anything whatever u want as soon as user start typing the name of the method. you have to provide inside the summary tag only.

这篇关于XML 注释 - 未在智能感知中显示的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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