How to open files in a repo that doesn’t contain a solution in Visual Studio 2015 – 075

tl;dr if you have a repo that doesn’t have a solution, don’t worry. You can still use File – Open – File to open files associated with the repo and Team Explorer will still track those files the same as if a solution were open.

P.S. I’m writing these tips for VS 2015. I’ll need to update for Visual Studio 2017.

For all my adult life (minus 2 years), the Solution file was your go-to starting point in Visual Studio. Even if you create a new text file via File – New – File, Visual Studio creates a new Solution nevertheless.

a solution still appears

It’s almost like Visual Studio has a Solution that’s in search of a problem.

Can’t believe I’ve never thought of that one before… Anyways…

Repos that do not contain a Solution

If you open a repo that doesn’t have a solution in it, you’ll see the following:

no solution found

You can still go to File – Open – File and open files that are associated with that repo. In fact, File – Open – File will open to that repo’s folder.

Opening a different Solution when Team Explorer is connected

A solution will always take precedence over a repo opened in Team Explorer.

For example, in the previous screenshot, I have a repo named “amend” that’s open, but this repo doesn’t a Solution. If I open a different solution that does not contain a repo, you’ll see that Team Explorer goes offline.

Team Explorer Offline

I guess this is Team Explorer’s way of saying, “Hey Look, I don’t want you to get confused which solution is tied to which repo.”

Switching to a different Repo with a Solution Open

Now having said that, let’s suppose I’m connected to a repo that has a solution, let’s say some ConsoleApplication54 project (you know you have them!) and you have the ConsoleApplication54 solution opened.

If you switch repos (via Team Explorer – Manage Connections) to any other repo, regardless whether it has a solution file opened, you’ll be in an odd state. On one hand you’ll have a solution opened, but Team Explorer will be tracking changes for an entirely different repo. This is the state you couldn’t get in to in the previous section.

It’s almost like a Game of Thrones battle (or so I’m told – haven’t seen or read yet) being played out inside the IDE: solutions vs repos.

2 thoughts on “How to open files in a repo that doesn’t contain a solution in Visual Studio 2015 – 075

  1. I want to check into this in 2017 Community too. In my coding-in-the-open git[hub] repositories, I *do* *not* *want” the builds to happen in the same folder sub-tree as the source and I want all the VS-project gunk to be in .gitignore one way or the other.

    At the same time, I don’t mind having a side folder where a VS Code project or a VS Studio Project could be unpacked, customized, and used, but be pre-configured to do a local build of the nearby managed-source working copy.

    I need to say this better. And maybe ask at the next Open Source Garage meet-up that isn’t during snow squalls.

    Like

Leave a comment