roslyn icon indicating copy to clipboard operation
roslyn copied to clipboard

Using cref to itself inside inheritdoc crashes VS

Open vsfeedback opened this issue 7 years ago • 5 comments

This issue has been moved from a ticket on Developer Community.


This is a new issue as inheritdoc is just being added in 16.4.0 preview 1. This problem therefor only happens in 16.4.0 preview 1 (or later?).

With the new feature, we can use /// <inheritdoc/> to define the same xml comments from the inheritted class on members that are inherited. /// <inheritdoc/> works fine, but /// <inheritdoc cref="MyProperty" /> crashes Visual Studio to desktop ('CTD') upon hovering the mouse over MyProperty.

To recreate:

  1. Create a new .NET Core Console App.
  2. Create a new interface: IMyClass with a member (can be property, method, ...) MyMember and add a summary to it with ///.
  3. Create a new class: MyClass that implements IMyClass (add ": IMyClass").
  4. Implement the member MyMember.
  5. Add /// <inheritdoc /> above MyMember. So far so good.
  6. Change <inheritdoc /> to <inheritdoc cref="MyMember"/> and move your mouse over MyMember. VS will crash before it can show the tooltip.

Original Comments

Visual Studio Feedback System on 10/6/2019, 09:24 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Visual Studio Feedback System on 10/8/2019, 01:54 PM:

This issue is currently being investigated. Our team will get back to you if either more information is needed, a workaround is available, or the issue is resolved.


Original Solutions

(no solutions)

vsfeedback avatar Oct 09 '19 18:10 vsfeedback

I just tried it out in 16.4 Preview 2. Issue still happens. I'll check back when Preview 3 is out.

RobbeSchepens avatar Oct 20 '19 21:10 RobbeSchepens

These are the logs from Windows Event Viewer:

Faulting application name: devenv.exe, version: 16.4.29411.138, time stamp: 0x5da11b53
Faulting module name: clr.dll, version: 4.8.4018.0, time stamp: 0x5d4a64a8
Exception code: 0xc00000fd
Fault offset: 0x00160348
Faulting process id: 0x32d0
Faulting application start time: 0x01d5883a247e06d3
Faulting application path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\Common7\IDE\devenv.exe
Faulting module path: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Report Id: 04b29d34-548d-4a8c-af95-55b8b4981c52
Faulting package full name: 
Faulting package-relative application ID: 
Application: ServiceHub.ThreadedWaitDialog.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ComponentModel.Win32Exception
   at MS.Win32.HwndWrapper.DestroyWindow(System.Object)
   at MS.Win32.HwndWrapper.Dispose(Boolean, Boolean)
   at MS.Win32.HwndWrapper.Dispose()
   at System.Windows.Interop.HwndSource.Dispose(Boolean)
   at System.Windows.Interop.HwndSource+WeakEventDispatcherShutdown.OnShutdownFinished(System.Object, System.EventArgs)
   at System.EventHandler.Invoke(System.Object, System.EventArgs)
   at System.Windows.Threading.Dispatcher.ShutdownImplInSecurityContext(System.Object)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.Dispatcher.ShutdownImpl()
   at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
   at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
   at Microsoft.Internal.VisualStudio.PlatformUI.BackgroundDispatcher.ThreadProc(System.Object)
   at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart(System.Object)
Faulting application name: bad_module_info, version: 0.0.0.0, time stamp: 0x00000000
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0x00000000
Fault offset: 0x00000000
Faulting process id: 0x4680
Faulting application start time: 0x01d5883a2c40d34a
Faulting application path: bad_module_info
Faulting module path: unknown
Report Id: 10e67215-d392-4f48-a429-1ac0c29bf980
Faulting package full name: 
Faulting package-relative application ID: 

RobbeSchepens avatar Oct 21 '19 18:10 RobbeSchepens

Hi, @sharwell I have tested this with the new 16.4 Preview 4, yet the same issue still happens.

Here are the steps I followed:

  1. Create a new Console App (.NET Core) C#.
  2. Add a new class MyClass.cs and replace its contents with the following code:
namespace ConsoleApp1
{
    interface IMyClass
    {
        /// <summary>
        /// This method tests some inheritdoc functionality.
        /// </summary>
        public void TestInheritDoc()
        {
        }

        /// <summary>
        /// This method tests some inheritdoc functionality.
        /// </summary>
        public void TestInheritDocWithCref()
        {
        }
    }

    class MyClass : IMyClass
    {
        /// <inheritdoc/>
        public void TestInheritDoc()
        {
            // Works fine when hovering mouse over "TestInheritDoc()" above.
        }

        /// <inheritdoc cref="TestInheritDocWithCref"/>
        public void TestInheritDocWithCref()
        {
            // Visual Studio crashes upon hovering mouse over "TestInheritDocWithCref()".
        }
    }
}
  1. Hover your mouse over the very last method TestInheritDocWithCref().

While I expect a tooltip with the summary of the method, the tooltip does not show and Visual Studio instantly crashes (crash to desktop).

I can test it tomorrow morning on my work laptop to see if the issue persists.

RobbeSchepens avatar Nov 12 '19 21:11 RobbeSchepens

@RobbeSchepens This change was fixed after 16.4 Preview 4 was released. It will appear in 16.4 Preview 5 or the 16.4 final release.

sharwell avatar Nov 12 '19 21:11 sharwell

Oh okay, thank you!

RobbeSchepens avatar Nov 12 '19 21:11 RobbeSchepens