• Stars
    star
    335
  • Rank 125,904 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This is a Visual Studio Code extension that provides a (.sln) Visual Studio Solution explorer panel..

⚠️⚠️⚠️ Microsoft has created a new extension which provides an official solution explorer for Visual Studio Code. You can find more information here.

vscode-solution-explorer

This extension adds a Visual Studio Solution File explorer panel in Visual Studio Code. Now you can navigate into your solution following the original Visual Studio structure.

It was originally intended to work with .Net Core solutions and projects. And that is why compatibility with other types of projects (such as .Net Framework or C++) is not guaranteed.

Visual Studio Code Solution Explorer Showcase

If you want to enjoy the full experience, you should install:

Table of Content:

If you like my work you can 🍺 buy me a beer and show that love 😁

Getting Started

To activate vscode-solution-explorer you have to first open a folder or workspace.

Then, you can find this extension displayed as:

  • a tab in the "Explorer" activity

Visual Studio Code Explorer tab

  • an activity with the Visual Studio icon

Visual Studio Code Activity

You can configure it in the Visual Studio Code settings panel, looking for "VsSolution: Show Mode" section:

Visual Studio Code Settings: Show Modes

Open Solutions

vscode-solution-explorer has several ways to open the solution files and you can configure them in the Visual Studio Code configuration panel.

Open Solution command

You can execute the "Open solution" command from the command palette or from the welcome view (if no solution has been found).

Open Solution Command

Omnisharp integration

You can enable omnisharp integration and vscode-solution-explorer will open the same .sln file you open with Microsoft extension.

Activate Omnisharp integration in settings panel

It will ignore .csproj files because vscode-solution-explorer cannot open a project file without a Solution.

You have to install Microsoft C# extension to enable omnisharp integration.

Find Solution files

You can use the automatic solution file finder activating some options in the Visual Studio Code settings panel.

Open Solution Command

The vssolution.openSolutions.inRootFolder setting will look for the solution files in the root folder.

inRootFolder

The vssolution.openSolutions.inFoldersAndSubfolders setting will search for the solution files in the root folder and its subfolders.

inFoldersAndSubfolders

And if you want to specify the subfolders where you want to look for the solution files you have to activate the vssolution.openSolutions.inAltFolders setting and specify the folders in the vssolution.altSolutionFolders setting:

inAltFolders

You can combine all of these options to find the best configuration for you.

Features

Adds a Solution Explorer panel where you can find a Visual Studio Solution File Explorer:

Run dotnet commands in solutions and projects

Only available when the project is of kind CPS (dotnet core).

  • Build: dotnet build
  • Clean: dotnet clean
  • New: dotnet new
  • Pack: dotnet pack
  • Publish: dotnet publish
  • Restore: dotnet restore
  • Run: dotnet run
  • Watch: dotnet watch run

Run dotnet commands in solutions and projects

If you want to customize the terminal commands you can change them in the settings json file. These are the default commands configuration:

{
  "vssolution.customCommands": {
    "addPackageReferenceToProject": [ "dotnet", "add", "\"$projectPath\"", "package", "\"$packageId\"" ],
    "addPackageReferenceToProjectWithVersion": [ "dotnet", "add", "\"$projectPath\"", "package", "\"$packageId\"", "-v", "\"$packageVersion\"" ],
    "addProjectReferenceToProject": [ "dotnet", "add", "\"$projectPath\"", "reference", "\"$referencedprojectPath\"" ],
    "build": [ "dotnet", "build", "\"$projectPath\"" ],
    "clean": [ "dotnet", "clean", "\"$projectPath\"" ],
    "createProject": [ "dotnet", "new", "\"$projectType\"", "-lang", "\"$language\"", "-n", "\"$projectName\"", "-o", "\"$folderName\"" ],
    "createSolution": [ "dotnet", "new", "sln", "-n", "\"$solutionName\"" ],
    "pack": [ "dotnet", "pack", "\"$projectPath\"" ],
    "publish": [ "dotnet", "publish", "\"$projectPath\"" ],
    "removeProjectFromSolution": [ "dotnet", "sln", "\"$solutionPath\"", "remove", "\"$projectPath\"" ],
    "removePackageReferenceFromProject": [ "dotnet", "remove", "\"$projectPath\"", "package", "\"$packageId\"" ],
    "removeProjectReferenceFromProject": [ "dotnet", "remove", "\"$projectPath\"", "reference", "\"$referencedprojectPath\"" ],
    "restore": [ "dotnet", "restore", "\"$projectPath\"" ],
    "run": [ "dotnet", "run", "--project", "\"$projectPath\"" ],
    "test": [ "dotnet", "test", "\"$projectPath\"" ],
    "watch": [ "dotnet", "watch", "run", "--project", "\"$projectPath\"" ]
  }
}

It will replace keywords like $solutionPath or $projectPath with the actual values.

As an example, if you want to compile in Release mode everytime you publish a project you can create somethink like:

{
  "vssolution.customCommands":  {
    "publish": [ "dotnet", "publish", "\"$projectPath\"", "-c", "Release" ]
  }
}

Drag and drop files, folders and projects

Drag and drop files, folders and projects

Create, delete, rename or project folders and files

Create, delete, rename or project folders and files

Create, delete, rename or move solution, solution folders and projects

Create, delete, rename or move solution, solution folders and projects

Add or remove nuget packages

Only available when the project is of kind CPS (dotnet core).

Add or remove nuget packages

If you want to use custom nuget feeds it will look for a file called nuget.config in the root folder of the project and its parent folders. If it finds this file, it will read the configuration and use it. If it does not find it, it will use the default nuget feed.

As an Example:

<configuration>
  <packageSources>
    <add key="Nuget.org" value="https://api.nuget.org/v3/index.json" />
    <add key="PrivateFeed" value="https://mydomain.com/myfeed/index.json" />
  </packageSources>
  <packageSourceCredentials>
	  <PrivateFeed>
	    <add key="Username" value="[email protected]" />
      <add key="ClearTextPassword" value="my_super_strong_password" />
	  </PrivateFeed>
  </packageSourceCredentials>
</configuration>

If you are working with /drive/path/to/project.csproj, it will look for:

  • /drive/path/to/nuget.config
  • /drive/path/nuget.config
  • /drivenuget.config
  • /nuget.config

Note vscode-solution-explorer only supports ClearTextPassword credencials in nuget.config

Update all nuget packages versions

Only available when the project is of kind CPS (dotnet core).

Update all nuget packages versions

Add or remove project references

Only available when the project is of kind CPS (dotnet core).

Add or remove project references

Create file templates

This extensions has a custom template system to create new files. When you create a new file you can select a template from the dropdown list:

Open Solution Command

You can customize the templates for your project. First of all click with the right mouse button on your solution file and select Install File Creation Templates. Then you have to move to .vscode/solution-explorer folder and you can find the file called template-list.json. This file contains the list of templates.

We strongly recommend you to update your templates after updating this extension:

Install Or Update templates

Extension Settings

You can configure the extension in the Visual Studio Code settings panel:

  • vssolution.showMode Show the solution explorer in the "activityBar", in the "explorer" pane or "none" to hide it. This feature is only for testing pourposes.

  • vssolution.solutionExplorerIcons "solution-explorer": custom items from vscode-solution-explorer extension. "mix": file and folder icons from the installed icons theme. "current-theme": all the icons are from the installed icons theme.

  • vssolution.outputChannelMode The solution explorer output channel mode: show on every single log, append but not show the pane or none.

  • vssolution.showTerminalOnCommand Show the terminal when a command is executed.

  • vssolution.trackActiveItem Select the active editor file in the solution explorer (not recomended).

  • vssolution.itemNesting Sets whether related items will be displayed nested.

  • vssolution.netcoreIgnore Folder and file names to ignore when get a dotnet core project content.

  • vssolution.xxprojItemTypes Type of XML element to put in the xxproj files.

  • vssolution.xmlspaces Spaces to be used for indenting XML output. It could be a number or an string. ex. "2", " " or "t".

  • vssolution.altSolutionFolders If there is no solution in the workplace root folder, it will search for solutions in any of these folders.

  • vssolution.win32Encoding Win32 "codepage" to "iconv.js" encoding equivalences.

  • vssolution.openProjectOnClick: Sets whether clicking a project in the explorer tree opens the underlying project file.

  • vssolution.customCommands Sets custom the terminal commands.

  • vssolution.openSolutions.inRootFolder Sets whether solutions will be automatically loaded from the root folder.

  • vssolution.openSolutions.inAltFolders Sets whether solutions will be automatically loaded from the vssolution.altSolutionFolders parameter.

  • vssolution.openSolutions.inFoldersAndSubfolders Sets whether solutions will be automatically loaded from the current opened folder and subfolders.

  • vssolution.openSolutions.selectedInOmnisharp Sets whether solutions will be automatically loaded from the current selected solution in Omnisharp extension.

Example
{
    "vssolution.showMode": "activityBar",

    "vssolution.solutionExplorerIcons": "current-theme",

    "vssolution.outputChannelMode": "show",

    "vssolution.showTerminalOnCommand": true,

    "vssolution.trackActiveItem": false,

    "vssolution.itemNesting": false,

    "vssolution.netcoreIgnore": [
        "bin",
        "node_modules",
        "obj",
        ".ds_store"
    ],

    "vssolution.xxprojItemTypes": {
        "*": "Content",
        "cs": "Compile",
        "cpp": "ClCompile",
        "cc": "ClCompile",
        "c": "ClCompile",
        "h": "ClInclude",
        "hpp": "ClInclude",
        "vb": "Compile",
        "fs": "Compile",
        "ts": "TypeScriptCompile"
    },

    "vssolution.xmlspaces": "2",

    "vssolution.altSolutionFolders": [
        "src"
    ],

    "vssolution.win32Encoding": {
        "932": "Shift_JIS",
        "936": "GBK",
        "950": "BIG5"
    },

    "vssolution.openSolutions.inRootFolder": false,
    "vssolution.openSolutions.inAltFolders": false,
    "vssolution.openSolutions.inFoldersAndSubfolders": false,
    "vssolution.openSolutions.selectedInOmnisharp": true,

    "vssolution.openProjectOnClick": false
}

Known Issues

Please report your issues: vscode-solution-explorer GitHub page

License

The source code is licensed under the MIT license.

The icons from (vscode-icons extension) are licensed under the Creative Commons - ShareAlike (CC BY-SA) license.

Branded icons are licensed under their copyright license.

Thanks to contributors

dfrencham darkmfj mwpenny remcoros marawan31 emrahcetiner martinothamar jesperbjensen Dvvarf vthg2themax jloureiro09 jbactad vlesierse m4ss1m0g Coda Hongyang Du (hond) Callum Marshall Philippe Desmarais LesanOuO ShalokShalom nev-21 Richard Willis panoskj lhz Spencer Farley Fadi Hania

Enjoy!

More Repositories

1

types-vue

Typescript decoratos for Vue js
TypeScript
20
star
2

CacheService

Doble layer cache for dotnet
C#
12
star
3

MinApiLib

Asp.Net Core >=7 Minimal Api Library with extensions, filters, and utilities to create easy cool APIs
C#
10
star
4

RoutingRecords

A small set of tools that help Asp.Net Core developers to program cool and simple APIs in .Net 5.
C#
9
star
5

crappy-api

dotnet test API: memory leaks, cpu exhaustion and so on
C#
8
star
6

netcoreconf22

Source code and slides for the Asp.net core 7 APIs session in Barcelona's NetCore Conf 2022
C#
8
star
7

zork-spanish-bot

El juego Zork en Español en formato Bot Framework de Microsoft
JavaScript
3
star
8

VerticalSliceExample

A vertical slice architecture example in C#
C#
3
star
9

fernandoescolar.github.io

My Jekyll Blog with hyde theme
SCSS
3
star
10

twitch-playground

A Twitch tool to manage notifications and messages in the chat.
JavaScript
2
star
11

Xunit.Assume

This library helps you implementing your unit tests following the 4-A, "AAAA" or Arrange-Assume-Act-Assert philosophy, with Xunit.
C#
2
star
12

vue-ts-pinia

Files for the VueJS Barcelona Meetup event session
JavaScript
2
star
13

dotnet-tool-gist

A tool to manage Github Gist code snippets (like nuget packages) in your dotnet projects.
C#
2
star
14

Developerro.AzureFunctions.CustomBindings

Azure Functions custom binding samples
C#
1
star
15

MarsRoverKata

Mars Rover - Coding Kata solved by Copilot
C#
1
star
16

demo

A tool to assist you in your presentation terminal demonstrations
C#
1
star
17

gab2022

Demos and presentations for the session AKS: from zero to hero in the Global Azure Bootcamp Spain 2022
Shell
1
star
18

Tokiota.Store

A web migration to Miscrosoft Azure example
C#
1
star
19

csharp10-preview

These are the slides of the session: Hot Crazy CSharp 10 for MadridDotNet (2021-06-30)
C#
1
star
20

crappy-fighter

The crappy figther shooter sketch game in TypeScript, using the apache cordova tools for visual studio
JavaScript
1
star
21

grooveshark

C# Grooveshark client
C#
1
star
22

Tokiota.Redis

A basic redis client for .net
C#
1
star
23

git-fuck

IRL git sub commands
Shell
1
star
24

netcoreconf2020

NetCoreConf files for "The Hitchhikers Guide to Azure" workshop
C#
1
star
25

netcoreconf2019

Project files for the Hot Crazy C# session in Barcelona's NetCore Conf 2019
Vue
1
star
26

cac-cli

cac-cli is a tool helps you managing configuration of your resources in your code repository
C#
1
star