Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Latest Update crashes visual studio (Read 1693 times)
cfeied
Junior Member
**
Offline


Posts: 49
Joined: May 18th, 2016
Latest Update crashes visual studio
Sep 8th, 2022 at 4:06am
Print Post  
Visual Studio 2022 updated itself to the latest version Version 17.3.3.  

I then had some problems with finding references and responsiveness, so I installed the latest version of Visual Micro (Release 22.09.05.0) via the visual studio 2022 extension menu. This caused visual studio to freeze. 

Before this happened I was running the most recent prior version of Visual Studio and Visual Micro -- I had just installed the special release of VM that included the timing change for serial reads and serial read timeouts, and this had been working fine before the upgrade of Visual Studio.

I uninstalled everything and started fresh with visual studio 2022 community edition. Everything worked fine. I installed Visual Micro => the same problem occurred, and that's where I'm stuck now.

Visual Micro is the only extension installed, and once it is installed visual studio is completely nonfunctional,  even with no solution loaded.

Symptoms are that top level menu dropdowns do not appear, and the menu name doesn't even become selected. Code does not display in code windows. The explorer is navigable but I cannot open code files with it. Basically nothing happens in response to most clicks on visual studio gui elements.  Occasionally a drop-menu opens when I click somewhere that's NOT a menu selector, and when that happens the drop menu is way off to the left side of my screen, nowhere near the window in which it should appear.

When I open a c++ project I don't get errors, but most things don't work. I can still exit, though...

When I open a c# .net project I do get errors as shown in the attached image.

I cannot disable the visual micro extension because I can't get the extension menu to appear. If I launch visual studio in safe mode, everything runs normally. However, it doesn't appear possible to disable or uninstall an extension in safe mode, so I'm limited to uninstalling and re-installing.  Cool

I'm going to roll back to an earlier release of Visual Studio and possibly to an earlier release of Visual Micro, but it would be good if this could work.   

VS version 17.3.3 is significantly faster than previous versions, and it has several nice improvements (e.g., multi-row tabs) that make it desirable...

Thanks for any help!
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2175
Joined: Feb 13th, 2019
Re: Latest Update crashes visual studio
Reply #1 - Sep 8th, 2022 at 9:25am
Print Post  
Thanks for the report.

Can you try running a repair on Visual Studio to ensure there are no other problems?

My machine is running VS2022 17.3.3 along with the latest Visual Micro without any issues currently.
  
Back to top
 
IP Logged
 
cfeied
Junior Member
**
Offline


Posts: 49
Joined: May 18th, 2016
Re: Latest Update crashes visual studio
Reply #2 - Sep 8th, 2022 at 2:49pm
Print Post  
Simon@Visual Micro wrote on Sep 8th, 2022 at 9:25am:
Thanks for the report.

Can you try running a repair on Visual Studio to ensure there are no other problems?

My machine is running VS2022 17.3.3 along with the latest Visual Micro without any issues currently.


Repair => no changes.

I'm glad to hear that you are running this combination without difficulties -- with that information I will pursue the problem at my end and update this forum with the results.

« Last Edit: Sep 8th, 2022 at 3:24pm by cfeied »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2175
Joined: Feb 13th, 2019
Re: Latest Update crashes visual studio
Reply #3 - Sep 9th, 2022 at 12:02pm
Print Post  
Thanks for the update.

Can you try the latest release available below, and let us know if this improves the situation?
https://1drv.ms/u/s!AsT00oFsGAmRoPN0-njUUmQ9pOU9Qw?e=qo44oY
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2175
Joined: Feb 13th, 2019
Re: Latest Update crashes visual studio
Reply #4 - Sep 9th, 2022 at 2:44pm
Print Post  
Can you confirm if you have the English Language pack installed in Visual Studio?  (Tools > Get Tools and Features > Language Packs)
  
Back to top
 
IP Logged
 
cfeied
Junior Member
**
Offline


Posts: 49
Joined: May 18th, 2016
Re: Latest Update crashes visual studio
Reply #5 - Sep 9th, 2022 at 6:03pm
Print Post  
Simon@Visual Micro wrote on Sep 9th, 2022 at 2:44pm:
Can you try the latest release available below, and let us know if this improves the situation?

Can you confirm if you have the English Language pack installed in Visual Studio?  (Tools > Get Tools and Features > Language Packs)


I have installed the latest version and updated boards and libraries. I do have the English language pack installed.

My problem is not resolved, but after more than 20 hours of investigation I do have some additional information. 

Here's what I have done:

  • Uninstalled Visual Micro
  • Uninstalled all versions of visual studio
  • Ran the VS InstallCleanup.exe
  • Removed nearly every registry entry related to visual studio
  • Installed all pending windows updates
  • Reviewed and resolved all EventLog issues of all types.
  • Multiple reboots including full power off & rest cycles.

 
Then I reinstalled Visual Studio 2022 version 17.0.32014.148, including only the desktop C++ and desktop .net framework solution paks. I unselected the newly bundled boost test and google test adaptors.

  • Tested existing c# solutions => OK
  • Tested existing c++ solutions => OK
  • Tested existing arduino-style solutions => they open and browse normally (I can't compile without VM).
  • Made a new C# "empty" winforms solution => OK 

Installed the most current version of visual micro

Now the following problem arises:

If I first open visual studio 2022 (devenv.exe), I can subsequently use the File/Open command to locate and open any of the above solution files, and the VS GUI behaves normally.

However, if I use explorer to double-click on any of the above solution files (even the new c# solution that contains only a single empty form) then the visual studio UX opens slowly before failing to respond in a stereotypical manner:
First, I see only the VS top menu with a blank area in the workspace. If I click on any menu entry, the solution explorer appears and the last active file appears but is missing most of its content. Clicking other files does not open them. The first time I click on a menu entry one of the menus does show its drop menu but (1) it's not the same menu entry that I had clicked, and (2) it's displayed in the left upper corner of my screen, nowhere near the parent window, and (3) I cannot interact with that menu. Subsequently clicking menu entries causes them to display a highlight but no further drop menus appear and nothing else happens in the entire UX. 

Disabling visual micro makes the problems go away. 
Re-enabling it makes them reappear.
This can be repeated ad infinitum.

Since the problem appears in a newly created "empty" c# winforms solution, that seems like the best repro scenario because visual micro should be doing almost nothing in that setting.

I have my antivirus disabled (though it makes no difference).
I have no network drives or mapped drives.
There are no other extensions installed.

One other thing I do notice is that if I run visual studio and browse to the sln file to open it, things do seem to run normally (I can build and upload) -- however, I am getting a half-dozen messages that the Visual Micro extension stopped responding for 10-15 seconds. In the past those have been very rare.

I ran procmon watching the solution directory and I really don't see much of anything different when visual micro is disabled (everything runs normally) vs when visual micro is enabled (nothing in the gui works). I do see devenv looking for a (nonexistent) .ino file when vm is enabled, but not much else, so I think we can rule out file contention.

Upon enabling the VisualMicro extension, a handful of errors appear in the Event log. I will attach a file showing these errors. They seem to involve 
  1. a missing (perhaps obsolete version) function used in tests and 
  2. a missing Gui cookie.

If the problem is not occurring for you or anybody else, there must be something in my environment that's triggering it, but after blowing away my dev environment so completely and reinstalling from scratch, I can't imagine what it could be.

I guess the next step is either to hook up a debugger to the devenv.exe process and try to break when it's not responding properly, or perhaps force a dump -- but without symbols that will be a long process. Maybe a performance trace using ETW would be a better next step...

At this point I would be grateful for anything you can suggest.  Cool


« Last Edit: Sep 9th, 2022 at 7:28pm by cfeied »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
cfeied
Junior Member
**
Offline


Posts: 49
Joined: May 18th, 2016
Re: Latest Update crashes visual studio
Reply #6 - Sep 9th, 2022 at 9:47pm
Print Post  
Update #2 for today:

After two full days of exploration, I am giving up and will revert to an older release of visual studio.  

Here's where I got to:

I was able to show that the event log errors referred to in my previous message are not specific to visual micro -- they now occur for me when any extension is enabled or disabled (or installed or removed). 

I have traced them to a known (recurring) problem that can be caused by several things, including certain MSFT components that have broken reference resolution in multiple releases. There is also some story here about different behavior for MSBuild, devenv.com, and devenv.exe.

These error messages may still be relevant to Visual Micro because one reported cause for this error is an extension that was not correctly ported to VS2022. Some of the VS2022 breaking changes apparently involve dlls (e.g., EnvDTE) with no workaround for backward compatibility. Some extensions have reportedly been forced to branch in order to handle both vs 2022 and earlier versions. 

Here are a couple of links I found. I'm sure you'll be able to tell right away whether they are relevant or just noise.

https://developercommunity.visualstudio.com/t/envdte-unable-to-use-in-packages-o...

https://github.com/dotnet/ResXResourceManager/issues/415

= = =
In the meantime, I rolled back to the interim release of Visual Micro and found no difference in behavior.

I then installed a large number of other optional packages from the visual studio installer. This made no difference.

I then took a solution folder containing a moderately complex embedded application and deleted every visual studio & visual micro artefact (.vs, _vm, vsproj, user, and .sln). I told visual micro to open it as an existing arduino project. An sln file was created, and *that* file can be double-clicked without causing the crash. 

However, I wasn't able to manually rebuild the project structure, which had multiple projects for libraries in a library folder as well as lots of included and non-included .h, .cpp. and .c files. Even the .ino file wasn't recognized as included code, so syntax highlighting was missing.  

I tried instead removing things one by one to identify what triggers the bad behavior, but I was unable to find anything that made a difference on its own. 

I then attached a debugger and watched an instance of devenv fail when I double click on the minimal sln file for a winforms solution. Basically devenv gets stuck and spins waiting for a thread to return and reading the message queue. If I click around in the interface it doesn't show that anything is happening, but it does occasionally throw exceptions like these:

Code (C++)
Select All
exception thrown: 'System.Runtime.InteropServices.COMException' in mscorlib.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in mscorlib.dll
Exception thrown: 'System.MissingMemberException' in Microsoft.VisualBasic.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in mscorlib.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in mscorlib.dll
Exception thrown: 'System.MissingMemberException' in Microsoft.VisualBasic.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in mscorlib.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in mscorlib.dll
Exception thrown: 'System.MissingMemberException' in Microsoft.VisualBasic.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in mscorlib.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in mscorlib.dll
Exception thrown: 'System.MissingMemberException' in Microsoft.VisualBasic.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in mscorlib.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in mscorlib.dll
Exception thrown: 'System.MissingMemberException' in Microsoft.VisualBasic.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in mscorlib.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in mscorlib.dll
Exception thrown: 'System.MissingMemberException' in Microsoft.VisualBasic.dll
Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in mscorlib.dll
Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in mscorlib.dll
Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in mscorlib.dll
Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in mscorlib.dll
Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in mscorlib.dll
 



I'm sure with a day of effort in ETW I could find out what's blocking it or where it's spinning, but since the problem doesn't appear to be anything I can fix on my end I'm giving up.

My guess right now is that it works for you because you have something on your system that I'm missing, like an older version of a dll in your gac, or perhaps an enterprise version was installed with load testing assemblies.

I'm willing to try again if you come up with something, but right now I've lost two work days and I have looming deadlines, so I'm going to try to roll back Visual Studio. 

All in all, this has been an somewhat harrowing experience.   Cool
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Latest Update crashes visual studio
Reply #7 - Sep 10th, 2022 at 4:08pm
Print Post  
Update. We have identified the issue happens when we try to display some tool bars at ide startup. If "tool bar auto visbility > all" is enabled the issue does not happen. This will be due to either being on or not being on the correct ui or background thead. The issue will be resolved during the next 24/48 hours.

We have also taken the opporunity to update our vs nuget packages from 17.0 to 17.3. Normally the nuget package version are not important other than being on the 17x major versions. However Microsoft are still working on the 2022 packages. Most are now mature. The Microsoft.Visual.Studio.ProjectSystem packages are the only ones still under development but we have updated them for good measure.

More to follow.
  
Back to top
WWW  
IP Logged
 
cfeied
Junior Member
**
Offline


Posts: 49
Joined: May 18th, 2016
Re: Latest Update crashes visual studio
Reply #8 - Sep 10th, 2022 at 6:29pm
Print Post  
Tim@Visual Micro wrote on Sep 10th, 2022 at 4:08pm:
Update. We have identified the issue happens when we try to display some tool bars at ide startup. If "tool bar auto visbility > all" is enabled the issue does not happen. This will be due to either being on or not being on the correct ui or background thead. The issue will be resolved during the next 24/48 hours.


// Ah, the old cross-thread control issue bites again!
If (InvokeRequired)
{ BeginInvoke(...);}


That was it.  Thank you!  

I thought I had tried every combination of UX settings, but that one had eluded me. 

I don't normally use the "AutoVis All" setting because it hides the serial terminal options when coding for the desktop, and because it takes up one row more than I need or want when working on embedded projects.

I might mention that I always find the operation of the interface element selection process confusing because the language "Toolbar Visibility" suggests that checked elements will be visible when working embedded, and automatically become invisible when working on desktop solutions. However, the opposite is true: the checked elements will be HIDDEN, either manually or with automatic switching based on code detection. Also, there's no checkmark to show whether Auto All or Manual All is set. I understand that this approach may have advantages, but I've seen posts on other sites suggesting that others are also confused by the nomenclature and the functionality.  In some future version, on-off-auto switches might make things a wee bit clearer.  

Thank you again for figuring this out!!!!!   Cool


« Last Edit: Sep 10th, 2022 at 6:33pm by cfeied »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Latest Update crashes visual studio
Reply #9 - Sep 10th, 2022 at 7:09pm
Print Post  
1)

Quote:
Toolbar Visibility" suggests that checked elements will be visible when working embedded, and automatically become invisible when working on desktop solutions

I am not sure that I understand this statement. Maybe it would be useful to know that a solution does not have a "type". A solution can contain multiple projects, some embedded and others such as C#.

The auto visiblility is designed so that when you are working in an Arduino project the tool bars will be visible yet when working in other project types they will be hidden. The "auto all" simply switches them all on, so that some can selectively switched off. Just a quick way of switching them all to auto-vis.

It is useful feedback, we are always reconsidering and know that sometimes we are too close to see it Smiley

The vMicro bar (button) doesn't need auto-vis.

2)

Were you showing your own project code the InvokeRequired? 

« Last Edit: Sep 10th, 2022 at 7:11pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
cfeied
Junior Member
**
Offline


Posts: 49
Joined: May 18th, 2016
Re: Latest Update crashes visual studio
Reply #10 - Sep 11th, 2022 at 2:20am
Print Post  
Tim@Visual Micro wrote on Sep 10th, 2022 at 7:09pm:
1)
I am not sure that I understand this statement. 
Maybe it would be useful to know that a solution does not have a "type". A solution can contain multiple projects, some embedded and others such as C#.

That's what I meant: An "arduino" project  vs. a "non-arduino" project. I personally wouldn't mix them in a single solution even though I'm usually writing both ends of the connection at the same time. In my experience doing so screws up reference tracking (which is already wonky when writing for arduino) so I just think of them as -ino solutions and non-ino solutions Smiley

Quote:
The auto visiblility is designed so that when you are working in an Arduino project the tool bars will be visible yet when working in other project types they will be hidden.

Right. Well, suppose I want to see the serial port all the time, and the USB Type only when I'm in an arduino project, and none of the others, ever. What am I supposed to check? And how am I supposed to know whether I am in Auto All or Manual All mode, or whether there's another mode,since neither of those two show any indication that they are active. (OK, I actually know that these are not modes, but only since you told me...)

Sometimes when I put a check mark next to one of the toolbars, the toolbar disappears. Other times the check mark goes in but nothing happens.  Sometimes check marks appear or disappear without me having checked them.  You can see why this might be a bit confusing.

Quote:

The "auto all" simply switches them all on, so that some can selectively switched off. Just a quick way of switching them all to auto-vis.

I would have understood better if those were called something like "Turn All On" and "Turn All Off." Especially if they turned on / off all the check marks and did not close the menu, so I could see what had happened. 

But in fact, I don't think the described behavior is exactly what's happening. For example, I just clicked Auto All =>  Programmers and Board options become unchecked whereas the others all become checked. I then clicked Manual All => Programmers and Board options became checked and everything else became unchecked. Nothing change in terms of which toolbars are displayed (I have an arduino-style project open).  And I have no idea what to expect when I switch to a c# project. Will I see just Programmers and Board Options, which are checked? Or will those be hidden and the unchecked ones will be visible? My original expectation was that if I clicked Auto All, all of the toolbars would be set to Auto => they would appear for Arduino and disappear when not Arduino. However, the fact that Auto All leaves several elements unchecked makes it seem unreasonable to expect this. 

I know I sound picky. There's a reason for that: I'm a biophysicist and physician, and for many years I designed hospital system interfaces (before I went to  Microsoft). The medical field is full of documented deaths caused by user confusion, so I can't help thinking about it. Thankfully we don't have to worry about that kind of thing here!!!
Cool

Quote:

Were you showing your own project code?

Since you had mentioned that the VS UX unresponsiveness problem depended on whether something was executing on the UI thread vs another thread, I was just making an oblique reference to the canonical way of writing to objects owned by one thread from a task that's running on another thread (i.e., by passing a delegate and requesting that the function be executed on the destination thread, using beginInvoke()). Sometimes synchronization contexts are helpful, of course, but when it comes to the UI thread they really just call Invoke or beginInvoke under the hood.

Where I come from (imagine 2000 developers in multiple countries all working on a single distributed application) often it's hard to know where a particular function will be executed, since it could be called from code running in any task on any thread. Since functions intended to be called from the UI thread might someday end up being called from a task thread, any call that needs to touch an owned element (especially any visual control) just gets reflexively wrapped in an (if InvokeNeeded) statement. 

One of the nice things about being at Microsoft was that the entire sourcecode for every version of every product was all available in a single source manager. It's quite interesting how much coding style varies across teams even with style cop turned on everywhere. Heavily visual applications are just completely different from those without much of a UX. 

If you disassemble a heavily visual application like Visual Studio, you'll see control.beginInvoke() everywhere, since virtually no work is done on the UI thread but the result of virtually all work is to change something in the UI.

Thank you again for finding the problem so quickly!!

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Latest Update crashes visual studio
Reply #11 - Sep 11th, 2022 at 2:28pm
Print Post  
Mising projects in a solution is okay, the intellisense would not be anyworse. We will shortly be miving to a different intellisense system that will perform better.

The threading issue is an internal vs issue. In vs we can't use the invokable system. Vs internally moved to async in vs2019. That has its own "background" and "main" threads that can be switched using the ThreadHelper methods of the Visual.Studio.Shell. Our code is on the correct thread, the problem is that vs is sending messages before the main thread is fully active. The issue happens when visual micro attempts to show a satus bar or output window message. The timing of when vs sends the started messages to us depends on how the IDE is started, either to open the IDE or to auto-open a solution or to show the "startup dialog".

I expect the solution will be to cache early startup messages and show them when some other later event happens where we know the UI has fully landed. Vs has always been sensitive in this area, when starting the ide, however the async implementation has made things faster but also more difficult for all.

  
Back to top
WWW  
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2175
Joined: Feb 13th, 2019
Re: Latest Update crashes visual studio
Reply #12 - Sep 12th, 2022 at 9:30am
Print Post  
Just to update we have published the latest release (22.09.05.4) which will work around this issue.

It is available in Extension Manager (VS2022), or for direct download from the top of the board below:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint