dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
7.04k stars 1.17k forks source link

VS 2019 16.2 Hangs when connecting via Remote Desktop #1543

Open vsfeedback opened 5 years ago

vsfeedback commented 5 years ago

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


When I reconnect to an existing Remote Desktop session on my development machine, the instance of Visual Studio that is already open will hang or become unresponsive. A "Visual Studio is busy" notification will appear after several seconds.

The development machine is running Visual Studio 2019 16.2 and Windows Server 2012 R2.

I am connecting to the remote via Remote Desktop Connection 10.0.18362.1 on Windows 10.


Original Comments

Fiona Niu[MSFT] on 7/26/2019, 05:16 AM:

Thank you for taking the time to log this issue! Could you please provide more information via the Visual Studio Feedback Tool(Help -> Send Feedback -> Report A Problem)so that we can conduct further research? The feedback tool will ensure that we collect the needed information for you without worrying about what to provide (recording, dump file or ETL trace).
Since this issue is now marked as Need More Info, that workflow is enabled in the Feedback Tool:

• Open Visual Studio Feedback tool.

• Click the banner letting you know that you have problems requesting your attention.

• Click this problem from the list

• Click "View their request and respond" from the problem details banner

• Add a comment, in the Attachments/Record: click Start Recording

• When the Steps Recorder tool appears, perform the steps that reproduce the problem.

• When you're done, choose the Stop Record button.

• Wait a few minutes for Visual Studio to collect and package the information that you recorded.

• Submit. You will be able to see the comment on Developer Community. For security reasons, your files come directly to us and don't appear on Developer Community.

For the full instructions, please see: https://docs.microsoft.com/en-us/visualstudio/ide/how-to-report-a-problem-with-visual-studio-2017?view=vs-2017#when-further-information-is-needed-need-more-info . For information about what data is collected, see https://docs.microsoft.com/en-us/visualstudio/ide/developer-community-privacy?view=vs-2017#data-we-collect

We look forward to hearing from you!

sjeynes on 7/26/2019, 06:09 AM:

I tried recording the steps before, and it said nothing was recorded, even though the problem did occur. I'll give it another try. These are the steps that cause the issue in Visual Studio:
1. Open Visual Studio 2019 on the remote server
2. Exit the remote session (do not sign out)
3. Reconnect to the remote session
4. Visual Studio 2019 will consistently be unresponsive in the remote session, even after several minutes
This time, I tried the Steps Recorder again, and it became unresponsive after I clicked Stop (screenshot attached). After about 2 minutes, the Steps Recorder said there was an error trying to save the recorded steps.

Fiona Niu[MSFT] on 7/28/2019, 07:41 PM:

Thanks a lot for providing the information. We’re sorry for the issues you’re experiencing. 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 7/30/2019, 06:00 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.

Visual Studio Feedback System on 7/31/2019, 06:59 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.


Original Solutions

(no solutions)

rladuca commented 5 years ago

I took a quick look at the dump.

There are two UI threads, the main thread and the status bar. Both have received a WM_TABLETADDED and are attempting to add a new tablet. This makes sense if the RDP is from a touch enabled machine to one without touch. There is a stylus thread per UI thread (completely normal) and both are attempting to get TabletInfo.

This leads down to PenIMC, which is attempting to CoCreate the WISP tablet manager. This should create a COM object and load wisp.dll. This is where the whole process is stalled. The COM CoCreate is sitting and waiting and WISP has yet to load.

I am not sure WPF can do anything about this, we are at the mercy of COM here. There are no actual deadlocks happening here in WPF code.

grubioe commented 5 years ago

@DoRonMotter - are you seeing this specific problem with RDP connections? Is this widespread? Thanks

JoeRobich commented 4 years ago

I am not sure if I have the exact same problem as the original poster, but VS crashes every time I reconnect to my work machine over Remote Desktop (which has become quite frequent over the past few months). The following error is in the event log

System.Collections.Generic.KeyNotFoundException in SystemResources.GetDpiAwarenessCompatibleNotificationWindow ``` Application: devenv.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.Collections.Generic.KeyNotFoundException at System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].get_Item(System.__Canon) at System.Windows.SystemResources.GetDpiAwarenessCompatibleNotificationWindow(System.Runtime.InteropServices.HandleRef) at System.Windows.Interop.HwndHost.BuildOrReparentWindow() at System.Windows.Interop.HwndHost.OnSourceChanged(System.Object, System.Windows.SourceChangedEventArgs) at System.Windows.SourceChangedEventArgs.InvokeEventHandler(System.Delegate, System.Object) at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean) at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs) at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs) at System.Windows.PresentationSource.UpdateSourceOfElement(System.Windows.DependencyObject, System.Windows.DependencyObject, System.Windows.DependencyObject) at System.Windows.PresentationSource.OnVisualAncestorChanged(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.UIElement.OnVisualAncestorChanged(System.Object, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(System.Windows.DependencyObject, System.Windows.Media.AncestorChangedEventArgs) at System.Windows.Media.Visual.FireOnVisualParentChanged(System.Windows.DependencyObject) at System.Windows.Media.Visual.RemoveVisualChild(System.Windows.Media.Visual) at System.Windows.FrameworkElement.set_TemplateChild(System.Windows.UIElement) at System.Windows.StyleHelper.ClearGeneratedSubTree(System.Collections.Specialized.HybridDictionary[], System.Windows.FrameworkElement, System.Windows.FrameworkContentElement, System.Windows.FrameworkTemplate) at System.Windows.StyleHelper.DoTemplateInvalidations(System.Windows.FrameworkElement, System.Windows.FrameworkTemplate) at System.Windows.StyleHelper.UpdateTemplateCache(System.Windows.FrameworkElement, System.Windows.FrameworkTemplate, System.Windows.FrameworkTemplate, System.Windows.DependencyProperty) at System.Windows.Controls.Control.OnTemplateChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs) at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs) at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs) at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs) at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType) at System.Windows.DependencyObject.InvalidateProperty(System.Windows.DependencyProperty, Boolean) at System.Windows.StyleHelper.InvalidateContainerDependents(System.Windows.DependencyObject, MS.Utility.FrugalStructList`1 ByRef, MS.Utility.FrugalStructList`1 ByRef, MS.Utility.FrugalStructList`1 ByRef) at System.Windows.StyleHelper.DoThemeStyleInvalidations(System.Windows.FrameworkElement, System.Windows.FrameworkContentElement, System.Windows.Style, System.Windows.Style, System.Windows.Style) at System.Windows.StyleHelper.UpdateThemeStyleCache(System.Windows.FrameworkElement, System.Windows.FrameworkContentElement, System.Windows.Style, System.Windows.Style, System.Windows.Style ByRef) at System.Windows.FrameworkElement.OnThemeStyleChanged(System.Windows.DependencyObject, System.Object, System.Object) at System.Windows.StyleHelper.GetThemeStyle(System.Windows.FrameworkElement, System.Windows.FrameworkContentElement) at System.Windows.FrameworkElement.UpdateThemeStyleProperty() at System.Windows.TreeWalkHelper.OnResourcesChanged(System.Windows.DependencyObject, System.Windows.ResourcesChangeInfo, Boolean) at System.Windows.TreeWalkHelper.OnResourcesChangedCallback(System.Windows.DependencyObject, System.Windows.ResourcesChangeInfo, Boolean) at System.Windows.DescendentsWalker`1[[System.Windows.ResourcesChangeInfo, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]._VisitNode(System.Windows.DependencyObject, Boolean) at System.Windows.DescendentsWalker`1[[System.Windows.ResourcesChangeInfo, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].VisitNode(System.Windows.FrameworkElement, Boolean) at System.Windows.DescendentsWalker`1[[System.Windows.ResourcesChangeInfo, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].VisitNode(System.Windows.DependencyObject, Boolean) at System.Windows.DescendentsWalker`1[[System.Windows.ResourcesChangeInfo, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].WalkLogicalChildren(System.Windows.FrameworkElement, System.Windows.FrameworkContentElement, System.Collections.IEnumerator) at System.Windows.DescendentsWalker`1[[System.Windows.ResourcesChangeInfo, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].WalkFrameworkElementLogicalThenVisualChildren(System.Windows.FrameworkElement, Boolean) at System.Windows.DescendentsWalker`1[[System.Windows.ResourcesChangeInfo, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].IterateChildren(System.Windows.DependencyObject) at System.Windows.DescendentsWalker`1[[System.Windows.ResourcesChangeInfo, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].StartWalk(System.Windows.DependencyObject, Boolean) at System.Windows.TreeWalkHelper.InvalidateOnResourcesChange(System.Windows.FrameworkElement, System.Windows.FrameworkContentElement, System.Windows.ResourcesChangeInfo) at System.Windows.SystemResources.InvalidateTreeResources(System.Object) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(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.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr) ```
luisvargascr commented 3 years ago

Hello, has this issue between RPD sessions and WPF apps been fixed?

I'm experiencing these issues when user disconnects from RDP (clicks on X) and then reconnects. I even posted a comment on https://github.com/dotnet/wpf/issues/3646 hoping someone would know how to go about this problem. Any ideas? Is this fixable with some Microsoft Service Pack? Thank you.

luisvargascr commented 3 years ago

Does anyone have any information on this RDP problem and how to fix it or, at least, circumvent it on WPF apps?

rcpandula commented 3 years ago

I am also seeing this problem... i guess it is a problem when dual monitors connected and one of them is touch...

is there any fix..?

ghost commented 3 years ago

I was working on a similar issue recently. From what I can see, WPF is trying to call a WISP COM component registered as class ID "A5B020FD-E04B-4E67-B65A-E7DEED25B2CF" in the registry. However in that problematic machine this class component is pointing to a legacy executable file wisptis.exe (modified in year 2004) under C:\Windows\SysWOW64, and WPF is stuck waiting for the response of it. This file is not included in a clean Server 2012R2 machine, and I even don't think it is an expected file in any newer OS version than Win8. It's possible that this file is installed into the machine when user is installing some legacy software. WPF here is a victim here.

If anyone is seeing the similar issue, maybe trying to get rid of the wisptis.exe from disk as well as the registry can resolve this (make sure you have a backup).

ABHIYANSHU commented 3 years ago

Is there any update on this ?

NeilAllen commented 2 years ago

Getting the same issue, as the OP, with VS2022.