I was wondering about how I can make visual studio show the exceptions that any method may throw, not just the .NET Framework methods (I am using C#).
For example, here's a picture showing that when I hover over Console.WriteLine it says "Exceptions: System.IO.IOException".
However when I do that for any method I wrote it doesn't say what exception it throws, as shown in the following picture.
So how do I make visual studio show those exceptions? Do I need to add a specific attribute to the method?
You can do this by adding an <exception>
tag to the methods comment:
/// <summary>
/// Fooes this instance.
/// </summary>
/// <exception cref="ArgumentNullException">Yay for exception</exception>
public void Foo()
{ }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With