Umbraco V9 - What is the best practice to develop using Kestrel or IIS?
Bit of a question regarding best practices here. I would love to hear your thoughts on this. I am a seasoned V7-8 dev but pretty new to .NET 5 and I am finding the actual process of development MUCH slower than asp.net to actually make changes, build and preview.
Using IIS and publish in VS2019 with host file and local domain names seemed to be the most promising way to work until I discovered that with every change a publish must be performed which is 1) Really slow as all the files are packaged over to a self contained folder and 2) IIS has to be stopped as it holds on to some of the files causing publish fails. 3) When creating initial templates using the back office (so that they get correctly registered in the database), all the views are created in the publish directory (not your source code directory) requiring these templates to be copied back into your source. 4) same applies to the default ~/models/umbraco directory - models are created in the publish folder.
Using the Visual Studio F5 (Kestrel server) seems to get better dev behavior as it's smart enough to know your working directory so models and views are created in your source folders. However having to relaunch a browser, login to the back end every time with every little change and build is really cumbersome as well.
Is there a way to make IIS behave like kestrel? where we can debug via attaching to process in a similar manner to developing in umbraco 7 and 8?
Ideally I like the idea of IIS just sitting in the background with a local domain name, developing out of Visual Studio, building and refreshing the browser without having to jump through all the publishing hoops. Maybe that is a pipe dream with the new way of doing things...
Additionally, running dotnet watch on the command line is quite fun, not super stable yet but just having it recompile whenever you save your C# code is pretty neat. You will want to keep an eye on it though, sometimes it drops out and stops the server.
Umbraco V9 - What is the best practice to develop using Kestrel or IIS?
Bit of a question regarding best practices here. I would love to hear your thoughts on this. I am a seasoned V7-8 dev but pretty new to .NET 5 and I am finding the actual process of development MUCH slower than asp.net to actually make changes, build and preview.
Using IIS and publish in VS2019 with host file and local domain names seemed to be the most promising way to work until I discovered that with every change a publish must be performed which is 1) Really slow as all the files are packaged over to a self contained folder and 2) IIS has to be stopped as it holds on to some of the files causing publish fails. 3) When creating initial templates using the back office (so that they get correctly registered in the database), all the views are created in the publish directory (not your source code directory) requiring these templates to be copied back into your source. 4) same applies to the default ~/models/umbraco directory - models are created in the publish folder.
Using the Visual Studio F5 (Kestrel server) seems to get better dev behavior as it's smart enough to know your working directory so models and views are created in your source folders. However having to relaunch a browser, login to the back end every time with every little change and build is really cumbersome as well.
Is there a way to make IIS behave like kestrel? where we can debug via attaching to process in a similar manner to developing in umbraco 7 and 8?
Ideally I like the idea of IIS just sitting in the background with a local domain name, developing out of Visual Studio, building and refreshing the browser without having to jump through all the publishing hoops. Maybe that is a pipe dream with the new way of doing things...
Any thoughts appreciated!
Cheers,
Jamie
Hi,
You can have kestrel running always, and the attach to it when you need to debug. This allows you to work on your code, and build when needed.
In Visual studio, next to the “start” option, there is a “start without debugging”
Well I can't believe I did not know about that. Never used it in that context as I usually am running everything through IIS. Thanks for the insight!
Additionally, running
dotnet watch
on the command line is quite fun, not super stable yet but just having it recompile whenever you save your C# code is pretty neat. You will want to keep an eye on it though, sometimes it drops out and stops the server.Great - thanks Sebastian, very cool. Tips are much appreciated.
Cheers!
is working on a reply...