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 for Visual Studio 2019 Preview #2014

merged 7 commits into from Oct 26, 2018


None yet
3 participants

jcansdale commented Oct 26, 2018

This PR does the required changes to make the extension play nicely with Visual Studio 2019 Preview.

  • Add Visual Studio 2019 compatible GitHub.TeamFoundation.16 project (Team Explorer extension)
  • Allow IGitActionsExt.CloneAsync to be called from Visual Studio 2019 (required a little reflection)
  • Use ITeamExplorerServices.OpenRepository rather than IVSServices.TryOpenRepository
  • Add Microsoft.TeamFoundation.* v16 assemblies to lib folder
  • Pass IServiceProvider rather than IAsyncServiceProvider to VSGitExt (avoiding type name collisions)
  • Commented out GraphsNavigationItemTests, which were previously ignored but now not compiling

How to test

This PR has touched the code responsible for cloning a repository and for opening an already cloned repository. We should check this functionality on Visual Studio 2015, 2017 and 2019.

Check Cloning a Repository

  1. Click File > Open > Open from GitHub...
  2. Select (or paste) a repository and Clone
  3. Check Team Explorer - Home appear with clone process
  4. Check name of repository appears on banner when clone completed
  5. Check Solution Explorer pane has target repository folder open

Check Opening a Repository

  1. Click Team > Manager Connections...
  2. Make sure you're logged into GitHub or GHE
  3. Double click on a repository under GitHub / GHE
  4. Check Team Explorer - Home opens with target repository
  5. Check Solution Explorer pane
  • Expect this to be empty on Visual Studio 2015
  • Expect this to contain target repository folder on Visual Studio 2017 and 2019

Possible issues

I believe the issue from #1859 is back in Visual Studio 2019 Preview, but I've heard this should be fixed in the public release. This shouldn't happen every time you install, but it's something to watch out for!

  • #1859: Corrupt extension cache and missing MEF exports

jcansdale added some commits Oct 25, 2018

Add Microsoft.TeamFoundation.* 16.0 assemblies
These are required for Visual Studio 2019 support.
Pass IServiceProvider not IAsyncServiceProvider
There are assemblies with exactly the same IAsyncServiceProvider
namespace + name. Change to use IServiceProvider instead to avoid
having to use assembly aliases. These were getting more complication
with the introduction of Visual Studio 2019 support.
Fix calling IGitActionsExt.CloneAsync from VS 2019
The ServiceProgressData type is in a Visual Studio 2019 assembly that
we don't currently have access to. Using reflection to call the
CloneAsync in order to avoid conflicts with the Visual Studio 2017
version. Progress won't be displayed on the status bar, but it appears
prominently on the Team Explorer Home view.
Add GitHub.TeamFoundation.16 project/asset
Create a GitHub.TeamFoundation.16 project that will install and execute
inside Visual Studio 2019.

This comment has been minimized.


jcansdale commented Oct 26, 2018

Double clicking a repository on the connect list brings up the Getting started... dialog. It seems closing a solution caused the dialog to appear. This should be easy enough to fix.

Update: Fixed!

Use ITeamExplorerServices.OpenRepository
Stop the `How would you like to get started?` dialog from appearing
when a repository is double clicked on.

Convert GitHubConnectSection to use
ITeamExplorerServices.OpenRepository instead of
IVSServices.TryOpenRepository to change repository context. This method
knows how to change context for Visual Studio 2015, 2017 and 2019.

@jcansdale jcansdale changed the title from [wip] Fix for Visual Studio 2019 Preview to Fix for Visual Studio 2019 Preview Oct 26, 2018

Commented out ignored test was breaking build
BrowsesToTheCorrectURL was already being ignored but is now failing to

This comment has been minimized.

codecov bot commented Oct 26, 2018

Codecov Report

Merging #2014 into master will decrease coverage by 1.12%.
The diff coverage is 16.66%.

@@            Coverage Diff             @@
##           master    #2014      +/-   ##
- Coverage   39.16%   38.03%   -1.13%     
  Files         405      372      -33     
  Lines       17343    16099    -1244     
  Branches     2398     2216     -182     
- Hits         6793     6124     -669     
+ Misses      10016     9538     -478     
+ Partials      534      437      -97
Impacted Files Coverage Δ
...GitHub.TeamFoundation.14/Services/VSGitServices.cs 0% <ø> (ø) ⬆️
....TeamFoundation.14/Connect/GitHubConnectSection.cs 0% <0%> (ø) ⬆️
...TeamFoundation.14/Connect/GitHubConnectSection1.cs 0% <0%> (ø) ⬆️
...TeamFoundation.14/Connect/GitHubConnectSection0.cs 0% <0%> (ø) ⬆️
src/GitHub.TeamFoundation.14/Services/VSGitExt.cs 90.16% <75%> (ø) ⬆️
...s.Reactive/Services/LocalRepositoriesExtensions.cs 0% <0%> (-100%) ⬇️
...rc/GitHub.App/Services/RepositoryPublishService.cs 0% <0%> (-78.27%) ⬇️
src/GitHub.Exports/Services/Connection.cs 0% <0%> (-76%) ⬇️
src/GitHub.Exports/SimpleJson.cs 0% <0%> (-47.22%) ⬇️
src/GitHub.Exports/Models/ConnectionDetails.cs 0% <0%> (-31.25%) ⬇️
... and 37 more

This comment has been minimized.


meaghanlewis commented Oct 26, 2018

This looks great to me! Tested in VS2015, 2017 and 2019

@meaghanlewis meaghanlewis merged commit adb4119 into master Oct 26, 2018

2 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
continuous-integration/appveyor/pr AppVeyor build succeeded

@meaghanlewis meaghanlewis deleted the fixes/2010-vs2019-preview branch Oct 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment