Author |
Topic |
|
Woody
Senior Member
Czech Republic
33 Posts |
Posted - Jan 22 2023 : 08:57:36 AM
|
Hey guys,
I have frequent freezes of VS 2022 (both 17.4.4 and 17.5 Preview 3.0) My solution is a large Unity game, C#. Every freeze happens after an alt-tab to Visual Studio and immediate shift+alt+O to open file in solution. The VS turns white and in 95% of cases it never recovers. I've never seen the same in VS2019 I was using for years. Anyone else having the same issue?
Regards, Tomas |
|
feline
Whole Tomato Software
United Kingdom
18992 Posts |
Posted - Jan 23 2023 : 08:12:51 AM
|
I don't recognise this problem description, and obviously this should not happen.
If you pause for a few seconds after the Alt-Tab, before opening Open File dialog, does this make a difference?
Can you please check Windows Task Manger in detailed mode, and see if Visual Studio is using a lot of CPU, or other resources, when this happens? Since the IDE occasionally recovers, it is possible it is caught in a loop, doing "something".
Does the Open File dialog actually display at all? I am wondering if you can see if the dialog has been populated with your file list or not.
Would it be possible to get a mini dump of the IDE in this problem state? The concern with doing this is that it can reveal some symbol information about your solution, but we are only interested in looking for the cause of the hang, but I do need to mention this so you are aware. If this is an option, this page explains saving out a mini dump file:
https://support.wholetomato.com/default.asp?W303
and then send me a link to download the file via the email:
[email protected]
including this thread ID or URL in the description, so we can match it up. As a rule dump files are to large to email as attachments. |
zen is the art of being at one with the two'ness |
|
|
Woody
Senior Member
Czech Republic
33 Posts |
Posted - Jan 24 2023 : 2:14:17 PM
|
If you pause for a few seconds after the Alt-Tab, before opening Open File dialog, does this make a difference? Yes, I think if I wait a bit it's fine. But it's hard to proof, because it's not a 100% reproducible.
Can you please check Windows Task Manger in detailed mode, and see if Visual Studio is using a lot of CPU, or other resources, when this happens? Since the IDE occasionally recovers, it is possible it is caught in a loop, doing "something".
VS is using one core and it looks like VAX is just processing messages
Does the Open File dialog actually display at all? I am wondering if you can see if the dialog has been populated with your file list or not. If it's frozen, the dialog never appears. Very rarely it unfreezes and the dialog is there.
Sadly, I can't send you minidump, but I made this video to better show how it behaves: https://youtu.be/osRIxMoYh5g
Regards, Tomas |
|
|
feline
Whole Tomato Software
United Kingdom
18992 Posts |
Posted - Jan 31 2023 : 06:55:50 AM
|
Since you can reproduce this fairly much on demand, can you please try the following to set up a test profile in Visual Studio, to see if the problem occurs there as well? It is possible the trigger is profile specific, which would help to explain why I don't recognise this problem.
First download the VS2022 specific installer for Visual Assist from:
https://downloadfiles.idera.com/WholeTomato/VA_X_Setup2471_0_x64.vsix
Next you will need extra details about the IDE install to create a test profile, which you get from running:
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
There will be a set of lines for each different version of Visual Studio that you have installed. For the version you want to install into, you want the "productPath", "dispalyName" and "installationVersion" lines, e.g.
productPath: C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\devenv.exe displayName: Visual Studio Professional 2022 installationVersion: 17.4.33213.308
You can then use the information from these three lines to make sure that the following command has the correct command line parameters. The values are:
/appidname: = displayName: /appidinstallpath: = productPath: /skuVersion = installationVersion:
The "/skuName:" value is one of "Community / Pro / Enterprise", note for the Professional version it is "Pro", not the expected "Professional".
The working command, for VS2022, using the values above, is - split into lines to make it easier to read and edit:
"C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\VSIXInstaller.exe" /appidinstallpath:"C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\devenv.exe" /skuName:Pro /appidname:"Visual Studio Professional 2022" /skuVersion:17.4.33213.308 /rootSuffix:"VATest" "C:\Users\%USERNAME%\Downloads\VA_X_Setup2471_0_x64.vsix"
The "rootSuffix" is the name of the test profile you want to install to, and this will be created if it does not already exist. The final parameter is the path of the VSIX installer for Visual Assist that you want to install. Once you have the command set up, the only parts you should need to edit are the skuVersion and the path to the VSIX file, can you please close all instances of Visual Studio and run this command.
Running this command installs VA into the test profile, but it does not load the test profile. If you created the test profile by installing VA, when you run the test profile it will be using the default IDE settings, without asking you which settings you want to use.
To now load the test profile you use the command:
"C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\devenv.exe" /RootSuffix VATest
To load your normal, default profile just load the IDE normally. To return to this test profile again, pass the /RootSuffix command line switch when loading the IDE. You can run both profiles at the same time, next to each other. In VS2019 and VS2022 the profile name will be shown just under the close button, in the top right hand corner of the main IDE window. If you export your IDE settings from your main profile you can them import them into the test profile. |
zen is the art of being at one with the two'ness |
|
|
Woody
Senior Member
Czech Republic
33 Posts |
Posted - Feb 06 2023 : 11:06:48 AM
|
It looked a bit complicated at first and the vswhere was not showing my VS Preview build, but -prerelease cmdline param fixed it and I think I've done all the steps correctly. So far I have no freezes, but what does that really mean? I even imported all my settings, so the difference is some kind of cache of the Visual Studio and/or VAssist and clean up could fix that? |
|
|
feline
Whole Tomato Software
United Kingdom
18992 Posts |
Posted - Feb 07 2023 : 09:51:53 AM
|
Thank you for the "-prerelease" command line switch, I haven't actually tried vswhere on the preview version before, so didn't realise you needed that.
Do you have the same extensions installed in the test profile and the main profile? I am looking for any obvious differences that might explain the problem. If the installed extensions are the same then this suggests the freezes are related to some form of corruption problem in your default profile.
To reset the profile, and hopefully fix the problem, can you please first export your IDE settings, since this is going to reset your IDE settings. You do this via:
IDE tools menu -> Import and Export Settings -> Export selected environment settings
Now you need to locate the profile install directory. Since you have both the VS2022 release and preview installed you will have at least 3 profile directories to choose between, since the test profile also create a profile directory.
If you run the:
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -prerelease
command again, note the first line, which will be something like:
instanceId: dcc31d3f
this is the hash that is used for the profile directory name. So note the hash for which ever instance you want to try this for first, release or preview.
Now you need to close all instances of the IDE and locate the directory where your default profile is stored.� This will be:
%USERPROFILE%\AppData\Local\Microsoft\VisualStudio\17.0_xxxxx where xxxxx is the instanceId hash, so its machine specific.� Since you have just created a test profile, you should see two directories, all with the same hash, but one with the name of the test profile at the end.� The default profile directory is the shortest directory name, so just the hash at the end of the directory name.
If you look inside this directory you should see a file called "privateregistry.bin".� You need to delete this file, which will be recreated next time you load the default profile. You will either get the default IDE settings or your online synced IDE settings, if you have enabled this option.� So you may well want to import your exported IDE settings, to restore your preferred settings.
When you do so all of your installed extensions will still be installed, but they will be Disabled, so you need to go into the dialog:
IDE Extensions menu -> Manage Extensions
and Enable them.� This will require an IDE restart to take effect.
At this point Visual Assist should be active and working normally in your default profile. If the freezes were caused by a problem in your default profile then this should have fixed the problem. |
zen is the art of being at one with the two'ness |
|
|
Woody
Senior Member
Czech Republic
33 Posts |
Posted - Feb 15 2023 : 10:08:05 AM
|
I thought it would help me if I clear VA cache and rebuild symbols and there was also update to 17.5.0 Preview 6, so I was testing that until I realized it doesn't help. Non of it. So I returned back to testing with the VATest profile and I'm able to freeze my Visual Studio 2022 17.5.0 Preview 6 too. I'm not sure if it was always the case, but every time I have the freeze, I'm attached to Unity with Unity Debugger (built in to the Visual Studio these days. It used to be a plugin. One must use VS menu "Debug" -> "Attach Unity Debugger") |
|
|
feline
Whole Tomato Software
United Kingdom
18992 Posts |
Posted - Feb 15 2023 : 12:53:51 PM
|
I have basically no experience with Unity, let alone debugging it. Are you able to reproduce this fairly easily and reliably? It seems that you can.
Is it easy to create a simple, default Unity game / project and try to reproduce this with this default project? I am looking for a fairly simple test I can run here, to get the same basic situation you have, and to hopefully reproduce this problem.
I am concerned though that this might be tied to your main solution, somehow, since you cannot be our only user working with Unity, and I don't recognise the symptoms you are seeing. |
zen is the art of being at one with the two'ness |
|
|
Woody
Senior Member
Czech Republic
33 Posts |
Posted - Feb 15 2023 : 4:34:27 PM
|
I was forced to work with VS 2022, because I need .NET 7 used in my Unity project. Number of ppl having the same needs could be fairly low. I will see if I can reproduce the same issue in a default empty Unity project and if I do, I will prepare a list of steps for you. |
|
|
feline
Whole Tomato Software
United Kingdom
18992 Posts |
Posted - Feb 20 2023 : 11:44:07 AM
|
Does the version of the Unity Editor matter for all of this? I have installed the Unity module for VS2022 on a Windows 10 machine, and created a Unity account. I have also downloaded a few different Unity games from github, but none of them want to load when opening the root directory in Unity Hub, I am being told the editor used by the projects is an old version. There is no obvious sign of an "upgrade version" button either. I was hoping this would be an easy way of getting a test case up and running here that contained a useful number of code files. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|
|
|