Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XML Comments - Exceptions not showing in intellisense

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

        }
    }
}

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.

Thank you.

like image 623
interesting-name-here Avatar asked Sep 27 '22 03:09

interesting-name-here


1 Answers

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.

like image 178
Deepak Sharma Avatar answered Sep 29 '22 01:09

Deepak Sharma