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 201 posts 493 karma points c-trib
    Oct 21, 2021 @ 14:20
    Jamie Attwood
    2

    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

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

    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”

  • Jamie Attwood 201 posts 493 karma points c-trib
    Oct 22, 2021 @ 21:13
    Jamie Attwood
    0

    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 5045 posts 15476 karma points MVP admin hq
    Oct 23, 2021 @ 09:54
    Sebastiaan Janssen
    0

    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 201 posts 493 karma points c-trib
    Oct 23, 2021 @ 13:35
    Jamie Attwood
    0

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

    Cheers!

Please Sign in or register to post replies

Write your reply to:

Draft