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)
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.
To make a new solution run the following command:
dotnet new sln
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.
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.
The next step is for us to add a new project to our .sln.
Right click the 'MyBlazorApp.sln' file in the solution explorer.
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:
My project name was:
The result was:
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.
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)
As a last resort only use reload window as described in the side notes, here you see it in an image.
(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:
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.
Now run the command and use the context menu to refresh the Dependencies and you'll see your change.