Dotnet Run Mac Asp.net Core 2.2

Asp.net
  1. Dotnet Core 2.2

Starting a New ASP.NET Core 2.2 C# Project with Visual Studio for Mac. Download the Mac version of Visual Studio. When you run the Visual Studio installer, it is going to ask you which. Starting a New ASP.NET Core 2.2 C# Project with Visual Studio for Mac. Download the Mac version of Visual Studio. When you run the Visual Studio installer, it is going to ask you which.

Dotnet run mac asp.net core 2.2 3

One of the most overlooked features of.net core is the new “dotnet watch” command. With it, it allows you to have a “live reload” of your ASP.net core site running without having to either run the “dotnet run” command, or worse do the “Stop the process in Visual Studio. Write your changes. Recompile and run again” routine. The latter can be very annoying when all you are trying to do is do a simple one line fix.If you are used to watches in other languages/tooling (Especially task runners like Gulp), then you will know how much of a boost watches are to productivity. The BasicsI highly recommend creating a simple ASP.net core project to run through this tutorial with. The tooling can be a little finicky with large projects so it’s easier to get up and running with something small, then take what you’ve learned onto something a little larger.First you need to install that actually runs the watcher tool.

Run the following from your package manager console. Application started. Press Ctrl + C to shut down.The first line tells us that it immediately picked up on the fact that we changed something in HomeController.cs and so it starts recompiling immediately. When we browse to we see our “New Value” shown immediately and we didn’t have to do anything else in terms of recompiling. Debugging With Dotnet WatchAnd now the big caveat of this feature.

Dotnet Core 2.2

Dotnet Run Mac Asp.net Core 2.2

There doesn’t seem to be a way to always have your Visual Studio debugger on the latest instance of the running code. The dotnet watch command itself spins up kestrel to host your code, but it’s hard to identify the PID of this particular process. I assume that you should be able to attach your debugger to this process once you find it, but as soon as you edit your code, a new process is created, rendering your debugger useless.For the most part, errors will flash by on your console window when they happen so should be easy to spot. Then when you actually need the full debugger experience like breakpoints, you will be able to attach it. Just don’t expect it to be “always on”.

Posted :