Search code examples
c#intellisensevisual-studio-2015visual-studio-2017quickinfo

Quick Info Not Displaying Possible Exceptions for Some Projects


I have always been able to hover over methods in my C# code and a list of possible exceptions is displayed in the quick info panel in Visual Studio 2015 Community - in fact this was working yesterday and this morning.

However, this afternoon after installing Visual Studio 2017 RC, I can no longer see this list of exceptions in 2 of my projects (in both VS2015 and VS2017).

My other projects seem to be okay, and I literally have no idea where to start with this. Do I need to check something in my project properties or the .csproj file itself?

Does anyone know why this might be happening?

I have installed all the updates for VS2015.


Solution

  • It seems that this exception list is not displayed for projecs which target the .Net-3.5 framework and below (I can see the exception list when the project targets .Net-3.5 Client Profile)

    This was confusing me because I originally copied the code from a .Net-4.5 project which was displaying the exception list into a project which targets .Net-3.5, and I did not think that this would effect the documented exceptions.

    When clicking on a method and pressing F12 (or right-clicking and selecting View Definition), I can see the following:

    .Net-3.5

    public static void WriteLine(string value);
    

    .Net-4.0

    //
    // Summary:
    //     Writes the specified string value, followed by the current line terminator, to
    //     the standard output stream.
    //
    // Parameters:
    //   value:
    //     The value to write.
    //
    // Exceptions:
    //   T:System.IO.IOException:
    //     An I/O error occurred.
    public static void WriteLine(string value);
    

    So it seems that the XML documentation for .Net-3.5 just doesn't include these exception details.

    I have not been able to find any other information on this, so not quite sure why the details are excluded when the same exceptions could be thrown regarldess of the framework version.