Skip to content

Conversation

siprbaum
Copy link
Member

@siprbaum siprbaum commented Jan 18, 2021

Closes: #989
Closes: #1352

Refactor the code to extract a method to trace the messages concerning
the checkin policy errors. This as preparational step to use this new
method in a different place, too.
Checkin Policies only work 32bit mode and for checkin and rcheckin an
appropriate note on how to fix the problem is shown to the user if there
are problems detected when evaluating the checkin policies.

Show the same note in `git-tfs shelve` when the user explicitely
requested via the commandline parameter `-p` to evaluate the checkin
policies.
Visual Studio versions >= 2017 (or is it actually 2015 ?) store the
necessary information for e.g. CheckinPolicies no longer in the registry.
Instead, they use a private registry usually found in

  C:\Users\<USER>\AppData\Local\Microsoft\VisualStudio\15.0_xxxxxx\privateregistry.bin

where the xxxxxx value is differing between the different installed Visual
Studio editions and/or minor versions.

This commit introduces the ExternalSettingsManager which loads this private registry
and we can then add the VS extension folders gathered from the SettingsStore to
our assembly search path.

Sadly, this only works for 32bit process and crashes in a 64bit process as soon
as a method tries to create an ExternalSettingsManager instance. Therefore
this is put behind a check so we only do it in a 32bit process.

This implies that the checkin policies are only working in 32bit mode!

In addition to the search patsh gathered from the ExternalSettingsManager, add
  <vsInstallDir>\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer
to the search path, as otherwise some of the checkin policies used in my dev
environment here didn't load because a library in that folder wasn't
found. This indicated to me that we still are not 100% compatibile to
what Visual Studio does, but at least this fixes all the custom checkin
policies here, so it can't be that bad.
Add seperate sections on checkin policies for VS2017 and VS2019 and
explain how loading a registry hive works so it might get easier for someone
to futher debug into failures for the checkin policies.

Furthermore, add a section that checkin policies for VS2015 are not
supported.

The old content is left intact, as it contains information which might
still be valuable, but it is marked as obsolete so it is clear that
it is only for older git-fs versions.
@siprbaum siprbaum mentioned this pull request Jan 18, 2021
@siprbaum siprbaum merged commit f6299bc into git-tfs:master Jan 20, 2021
@siprbaum siprbaum deleted the pr_checkinpolicies branch January 20, 2021 20:13
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.

Policy Assemblies failed to load Local Check-In policies
2 participants