Skip to content

A solution explorer for dotnet applications (e.x. a Blazor Server or Blazor Webassembly application targeting the framework .net5)

Notifications You must be signed in to change notification settings

nvmkpk/dotnetSolutionExplorer

Repository files navigation

Repo is public here
Email me: huntercfreeman@gmail.com

List of features (unordered)

  • Add Existing Project
  • Add New Project
  • Remove Project from Solution
  • View all referenced nuget packages and their versions
  • Add Project Reference
  • Remove Project Reference
  • Auto namespace generation when making new file
  • Choose a .sln file anywhere in workspace (does not have to be root)
  • Templated files (new .cs file will have namespace and class name generated for you based on the name of the file)

stepOne

In order to showcase the capabilities of this extension I will make a .net5 application from scratch and show the important details pertaining to this extension in named sections.

New Solution

To make a new solution run the following command:

dotnet new sln

stepTwo

Now we can open the extension. If you opened the extension already run the vscode command titled 'reload window' by pressing 'ctrl' + 'shift' + 'p' or close and reopen vscode.

stepFour

stepFive

Now we see our .sln in the solution explorer.

It is important to acknowledge that the vscode folder explorer is still available to us above the solution explorer. When you click a file in the solution explorer it will scroll to and highlight that respective file in vscode's folder explorer. This allows for the full use of vscode's context menu when right clicking a file if that is so desired.

Add New Project to .sln

The next step is for us to add a new project to our .sln.

Right click the 'MyBlazorApp.sln' file in the solution explorer.

stepSix

Follow the vscode prompts that show at the top middle of vscode.

If you don't know what .net Microsoft template you want type the following command in the terminal to find the one you want to new.

dotnet new --list

I entered the following:

My template was:

stepEight

My project name was:

stepNine

The result was:

stepTen

I purposefully go out of my way to not run any commands for you. I am under the belief that users first don't want me running random things in their terminal. And second if I run the command then you cannot alter it if you want to customize something.

You'll notice that I figured out how to put the command immediately into the console at some point and as such started doing so. I standardized this so all commands now either appear in the integrated terminal if one is open or as a notification to allow external terminal usage.

stepEleven

Notice how the solution explorer did not update? In short it works similarly to Microsoft SQL Management Studio. In other words you have to right click the item you want to refresh and click refresh.

Side notes:

  • I refresh for you when I can but changing files outside vscode (i.e. in the terminal) is something I don't know how to have an event for.
  • If a context menu refresh does not do the trick use the vscode command 'reload window' by pressing: 'ctrl' + 'shift' + 'p' and then typing 'reload window' and hittting 'enter'. (or you can close and reopen vscode)

stepTwelve

As a last resort only use reload window as described in the side notes, here you see it in an image.

stepThirteen

(I have to reload window when adding a project on a Windows machine but not when on Ubuntu I need to find time to fix this)

This all results in the following:

stepFourteen

Add a Project Reference

stepFifteen

stepSixteen

Upon clicking the context menu option 'Add Project Reference' your operating system's file explorer will open for you to select a .csproj file.

The following will be placed into the terminal for you to run with the enter key.

It is important to note that I thought of those who use external terminals. I will NOT force open a terminal if one is not open.

If one is using an external terminal you will receive a notification of the command to run instead of me placing it in the integrated terminal.

stepSeventeen

Now run the command and use the context menu to refresh the Dependencies and you'll see your change.

About

A solution explorer for dotnet applications (e.x. a Blazor Server or Blazor Webassembly application targeting the framework .net5)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published