Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exception on saving many tab groups #28

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

andronov-alexey
Copy link

@andronov-alexey andronov-alexey commented Jun 14, 2020

Problem cause:

The problem arises when user tries to store too many tab groups. Since we store all tab groups (with full paths to all open tabs for each group) in one string and windows registry's max string length is 1MB we pretty quickly reach this limit and registry key storing operation fails.

Solution:

I propose to store each tab group in its own registry key instead of saving all groups in one key.
This way the amount of groups becomes unlimited and length limit for all tabs paths for one group is ~500k (aforementioned 1 MB)

Results:

Here's how the registry storage look like before and after the proposed change:
BeforeAfter

Important:

This version will save open tabs in different format in registry so previous versions of this extension won't be able to open it (but they could still work with their "old" format).

Additional fixes:

  • Add appveyor script
  • Bump Target Framework version from v4.5.2 to v4.8
  • Fix MSVC warning about synchronized extension loading
  • Fix a couple of exceptions on project open/close

More:

I've also merged this bugfix with MSVC2019 support fix and published it on Open VSIX Gallery.
Feel free to download and test it :)

Resolves #27

@nickwigton
Copy link

Had used SaveAllTheTabs for VS2017 for a while, gave the published version of this a try for VS2019, having no issues. Thank you for doing this. Here's hoping the PR is accepted.

@djayfresh
Copy link

So this plug in will no longer suppor VS2017?

<entry> <record>857</record> <time>2020/10/02 18:09:12.417</time> <type>Error</type> <source>VisualStudio</source> <description>CreateInstance failed for package [SaveAllTheTabsPackage]Source: &apos;mscorlib&apos; Description: Could not load file or assembly &apos;Microsoft.VisualStudio.Shell.15.0, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos; or one of its dependencies. The system cannot find the file specified.&#x000D;&#x000A;System.IO.FileNotFoundException: Could not load file or assembly &apos;Microsoft.VisualStudio.Shell.15.0, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos; or one of its dependencies. The system cannot find the file specified.&#x000D;&#x000A;File name: &apos;Microsoft.VisualStudio.Shell.15.0, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos;&#x000D;&#x000A; at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)&#x000D;&#x000A; at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)&#x000D;&#x000A; at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)&#x000D;&#x000A; at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)&#x000D;&#x000A;&#x000D;&#x000A;WRN: Assembly binding logging is turned OFF.&#x000D;&#x000A;To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.&#x000D;&#x000A;Note: There is some performance penalty associated with assembly bind failure logging.&#x000D;&#x000A;To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].&#x000D;&#x000A;</description> <guid>{A0217E5B-1DFA-4FA1-98AA-7550D6A32076}</guid> <hr>80004005 - E_FAIL</hr> <errorinfo></errorinfo> </entry>

Unable to open extension inside VS2017. Was still having issue [#27] which is why I just tried this updated version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Catastrophic failure - Saving any new tab set
3 participants