Running dotnet command line within Visual Studio

The majority of .NET core tutorials online seem to use Visual Studio code, rather than Visual Studio (Full fat? Is there a proper term for the full version? I use Professional but there is also Community, Enterprise etc).

These tutorials make the most of the integrated terminal within VS code for running dotnet command line commands (dotnet new, dotnet build etc).

I am struggling to find where to execute these commands in Visual Studio. Where is the right place to do this? I have .NET core SDK installed.

I have seen some suggestions for the package manager console - although this seems odd, why should I be running dotnet commands via a "package manager console"?


Solution 1:

  1. The full version of Visual Studio is "Visual Studio", "Code" is what differentiates "Visual Studio Code".

  2. As far as an integrated command line inside Visual Studio goes, the Package Manager Console is it. It's basically just powershell, with some addins from Visual Studio and any extensions or NuGet packages you have installed. It gets its name from the fact that it was introduced specifically for the management of NuGet packages, but was quickly co-opted by things like Entity Framework, and just continued to grow from there. Admittedly, Microsoft should probably consider rebranding it, but there's so much documentation, articles and tutorials out there that reference the "Package Manager Console", that it would probably actually create more confusion if they renamed it.

  3. While you can run dotnet commands through it, I'd imagine the results would be a bit unpredictable. Perhaps I'm wrong here, as I've never even tried to do things like dotnet new from the PMC, but the PMC is not really directory-based like a traditional console window. It's more contextual in nature, applying commands to target projects. I do know that things like dotnet restore and such work fine, and dotnet new may as well. You'll just have to try it.

That said, I tend to take an all or nothing approach with Visual Studio. It's a beast, and if you're going to install it and use it, you might as well use it. You can do everything you can do with dotnet through the GUI. And, for those few times where you might need something special, you can pop a console window. If you want to do everything with dotnet, Visual Studio quickly becomes overkill, and Visual Studio Code would probably be much more efficient for your workflow.

Solution 2:

Update: Visual Studio 2019 16.6 now has it's own Terminal (Hoorray!). Check View -> Terminal or try to press Ctrl + `.

Old answer:

There are extensions for that. I tried BuiltinCmd and Whack Whack Terminal, the latter worked better for me. You can choose between CMD and PowerShell, all dotnet CLI commands works just fine. Whack Whack terminal screenshot with dotnet watch run