Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Jamie Attwood 174 posts 427 karma points c-trib
    Oct 21, 2021 @ 14:20
    Jamie Attwood

    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 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!



  • Søren Gregersen 436 posts 1875 karma points MVP 2x c-trib
    Oct 22, 2021 @ 15:58
    Søren Gregersen


    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”

  • Jamie Attwood 174 posts 427 karma points c-trib
    Oct 22, 2021 @ 21:13
    Jamie Attwood

    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!

  • Sebastiaan Janssen 4993 posts 15138 karma points MVP admin hq
    Oct 23, 2021 @ 09:54
    Sebastiaan Janssen

    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.

  • Jamie Attwood 174 posts 427 karma points c-trib
    Oct 23, 2021 @ 13:35
    Jamie Attwood

    Great - thanks Sebastian, very cool. Tips are much appreciated.


Please Sign in or register to post replies

Write your reply to: