When showing off some VS2017 features at our VTdotNET meetup, I made a last minute decision to demo the ability to clone a repository right from GitHub. Then I thought I would combine that with other things I planned to demo.
I already had just the right repo sitting in my GitHub account. A small ASP.NET Core project that was built with Visual Studio 2015 using project.json for its metadata. It’s at https://github.com/julielerman/NetCoreSolutionToMigrateToVS2017.
I had this same solution on my laptop already to use for another demo: showing off VS2017’s ability to auto-migrate a project.json based solution to the new csproj based format for .NET Core projects.
Clever me, I decided to kill two birds with one stone. Clone the repo and have the migration run as it was opening that solution.
So I started up Visual Studio 2017 (since I wanted to show how fast that is) and began the process of cloning the solution from my GitHub repo. I already had my credentials set up and was able to go to File, Open and Open from Source Control.
This opens the Team Explorer window and I clicked the Clone option, which then opened a window showing all of the accounts I’m connected to.
I expanded my own account and scrolled down to the repo I wanted, selected it and clicked the Clone button.
The solution got cloned and then it opened up in Visual Studio.
But it never triggered the migration! And if you look at the solution, you can see that the project I expanded still has its xproj file and its project.json file. At the time I was confused but now that I know what happened, the answer to why this didn’t migrate is very visible in that screenshot of the Solution Explorer. However, one of the developers who was watching this and had just done another demo with Visual Studio 2017, identified the problem quickly.
Let’s move on for some more clues.
I closed the solution. Then from File/Open, I browsed to the place where it had been saved on my computer, and selected the sln file to open. This time, the same exact solution opening up in VS2017, did indeed trigger the migration, which is quite obvious thanks to this screen.
Then I let the migrate feature do its job. When it was finished, you can see that the project no longer has its xproj and project.json files.
Now, look at this new Solution Explorer screenshot compared to the previous one.
And then take a look at the list of new VS2017 features in the Release Notes (https://www.visualstudio.com/en-us/news/releasenotes/vs2017-relnotes) under the section IDE and see if you can tell what the cloning did differently when opening the solution than just opening the solution directly from the drive.
Also, I will find out if this is by design or possible a behavior that can get modified to behave the way I had expected. 🙂
Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!