Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/274.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# XML注释-intellisense中未显示的异常_C#_Visual Studio_Intellisense_Xml Comments - Fatal编程技术网

C# XML注释-intellisense中未显示的异常

C# XML注释-intellisense中未显示的异常,c#,visual-studio,intellisense,xml-comments,C#,Visual Studio,Intellisense,Xml Comments,我有一个方法在名称空间下抛出异常:MyApp.Domain。我在命名空间下有一些自定义异常:MyApp.Domain.exceptions。所以我得到的是: 使用MyApp.Domain.Exceptions 使用制度; 名称空间MyApp.Domain { 公共类 { ///这种方法确实有用 ///MyCustomException如果x ///如果是y,则为一般例外 公共空间{ //做事情 } } } 我用intellisense获得了我的总结,但没有例外。我是否必须使用include并

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

使用MyApp.Domain.Exceptions
使用制度;
名称空间MyApp.Domain
{
公共类
{
///这种方法确实有用
///MyCustomException如果x
///如果是y,则为一般例外
公共空间{
//做事情
}
}
}
我用intellisense获得了我的总结,但没有例外。我是否必须使用include并创建外部xml注释文件,因为它们位于不同的名称空间下?intellisense、mycustomexception或system.exception中均未显示任何异常


谢谢。

事实上,一旦您键入完整的方法名称,然后用鼠标悬停在上面,就会看到
异常标记

如果您想在开始键入方法名称时立即显示异常,则必须在摘要标记中提供异常,并用

//
///这是我的日期转换方法
///例外情况:
///异常-这将在您开始键入方法名称和方法结束后立即显示。
/// 
///  
希望它能让你明白你想要什么


只要用户开始键入方法的名称,就可以显示任何您想要的内容。您只需在摘要标签内提供。

我不确定是否在跟踪您。您的意思是当您开始键入“new myc”时,intellisense没有显示您的自定义异常吗?当我键入DoStuff()时,我没有在intellisense中获得异常列表但我得到了摘要。即使在键入完整的方法名称之后,也不会显示异常。VS2015不再支持此功能,并且与这些答案重复。和@GibralterTop-这个问题在更新1中得到了解决,并且在完成键入和结束行字符后仍然没有看到它,正如预期的那样(或者至少像以前一样…)。完成后,鼠标悬停仍不显示异常列表。对于预定义的.net方法,其显示??对我来说,您的xml注释似乎是正确的。你试过重新启动VS吗?随着智能感知的消失。。。它正在显示,但现在也不是预定义的。重新启动VS和重新启动PC,但无效。VS2015。我猜intellisense已经“出去吃午饭了”。不幸的是,因为我只是从XML注释开始。将暂时使用您的答案。非常感谢。VS2015中不支持功能。VS2015更新1中修复了功能
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

        }
    }
}
     /// <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>