Message: An unhandled exception of type 'System.InvalidOperationException' occurred in PresentationCore.dll
Additional information: The visual tree has been changed during a 'VisualTreeChanged' event.
At first, I thought it might be related to the issue VS 2017 caused with VSIX projects. But this was a different error. After Googling, I discovered here that you could fix it by disabling Enable UI Debugging Tools for XAML.
Tools --> Options --> Debugging --> General --> Uncheck Enable UI Debugging Tools for XAML.