Monday, May 8, 2017

GitExtensions And Visual Studio 2017

I just finished installing Visual Studio 2017 and one of my favourite extensions, GitExtensions, https://github.com/gitextensions/gitextensions. For Visual Studio 2017, for now, a temporary version of GitExtensions must be installed, due to the changes in add-in architecture. The direct link for this, for now, is https://github.com/gitextensions/gitextensions/pull/3439.

Upon getting everything installed and configured as desired, I proceeded to try to sync with an existing repo, hosted on a personal, internal Git server. This server is running HTTPS with an internal, Active Directory CA-generated, certificate. Naturally, this certificate is not normally trusted by Git.

Following the excellent guide located here, https://blogs.msdn.microsoft.com/phkelley/2014/01/20/adding-a-corporate-or-self-signed-certificate-authority-to-git-exes-store/, I was able to get Git and the GitExtensions application to push/pull as expected from the repo. However, trying a sync in Visual Studio 2017 failed with the message "SSL certificate problem: unable to get local issuer certificate".

After much digging, I was able to find out that in Visual Studio 2017, due to the change in add-in architecture, the GitExtensions add-in is actually running out of the directory C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\. Therefore, any of the path references regarding configs, .crt, and .pem files in the article above need to be adjusted to point to this path, particularly if the internal certificate information will be added to the computer-wide .crt file.

Hopefully, this information will help someone else as well. I was unable to find a direct reference to this new path, as VS2017 is still rather new. I ended up using SysInternals' excellent tool, procmon.exe, to watch all the file activity until I found the reference to the path being used to run the git.exe command from a VS2017 Git Sync operation.