Updating my personal website from .NET 6 to .NET 8 LTS in 15 min
Read full transcript 12 segments
-
hey friends this is totally random but hey friends this is totally random but it is Saturday afternoon my wife is it is Saturday afternoon my wife is it is Saturday afternoon my wife is working at the hospital tonight my kids working at the hospital tonight my kids working at the hospital tonight my kids are running around the neighborhood so I are running around the neighborhood so I are running around the neighborhood so I thought I would take a moment and thought I would take a moment and thought I would take a moment and upgrade my websites toet 8 because upgrade my websites toet 8 because upgrade my websites toet 8 because that's what you do when you're a huge that's what you do when you're a huge that's what you do when you're a huge nerd so let's uh go to split screen here nerd so let's uh go to split screen here nerd so let's uh go to split screen here and take a look at what's going on if we and take a look at what's going on if we and take a look at what's going on if we go to Hanselman dcom which is my go to Hanselman dcom which is my go to Hanselman dcom which is my brochure Weare website we scroll all the brochure Weare website we scroll all the brochure Weare website we scroll all the way down to the bottom we can see that way down to the bottom we can see that way down to the bottom we can see that hanson.com is currently being run on net hanson.com is currently being run on net hanson.com is currently being run on net 6 net 6 which is the LTS or the 6 net 6 which is the LTS or the 6 net 6 which is the LTS or the long-term support release and if we go long-term support release and if we go long-term support release and if we go to net the main website and click to net the main website and click to net the main website and click download we can see that a couple of download we can see that a couple of download we can see that a couple of weeks ago uh we had version weeks ago uh we had version weeks ago uh we had version 8.02 of net 8 which is long-term support 8.02 of net 8 which is long-term support 8.02 of net 8 which is long-term support long-term support means that I won't long-term support means that I won't long-term support means that I won't have to think about it as much maybe as have to think about it as much maybe as have to think about it as much maybe as the other versions of course you can the other versions of course you can the other versions of course you can click on all.net versions and you can click on all.net versions and you can click on all.net versions and you can see all the different versions that are see all the different versions that are see all the different versions that are available I was available I was available I was onnet onnet onnet 6 which is still in support until this 6 which is still in support until this 6 which is still in support until this November but if I switch over to net 8 November but if I switch over to net 8 November but if I switch over to net 8 get new features new performance get new features new performance get new features new performance benefits and of course support gets benefits and of course support gets benefits and of course support gets moved out a couple of years so there's moved out a couple of years so there's moved out a couple of years so there's really no reason for me not to do it so really no reason for me not to do it so really no reason for me not to do it so let's let's just do it you know live let's let's just do it you know live let's let's just do it you know live because why not right because why not right because why not right so I'm going to switch to the so I'm going to switch to the so I'm going to switch to the Hanselman directory here Hanselman directory here Hanselman directory here I want to point out that I'm using the
-
I want to point out that I'm using the I want to point out that I'm using the net 8 net 8 net 8 SDK all right and let's go ahead and SDK all right and let's go ahead and SDK all right and let's go ahead and make myself make myself make myself smaller we'll make this a little bit smaller we'll make this a little bit smaller we'll make this a little bit bigger and then I'll go and make sure bigger and then I'll go and make sure bigger and then I'll go and make sure that we are up to date with a nice that we are up to date with a nice that we are up to date with a nice little get pull right there and let's go little get pull right there and let's go little get pull right there and let's go and do a code dot to bring up visual and do a code dot to bring up visual and do a code dot to bring up visual studio code which I will also make studio code which I will also make studio code which I will also make larger um and then of course I'm going larger um and then of course I'm going larger um and then of course I'm going to be using the C dev kit which gives me to be using the C dev kit which gives me to be using the C dev kit which gives me this solution Explorer up here so this this solution Explorer up here so this this solution Explorer up here so this is using net on vs code and I've got an is using net on vs code and I've got an is using net on vs code and I've got an extra extension in installed here which extra extension in installed here which extra extension in installed here which is called the C devkit and you can just is called the C devkit and you can just is called the C devkit and you can just sign into it the way that you sign into sign into it the way that you sign into sign into it the way that you sign into Visual Studio Community or something Visual Studio Community or something Visual Studio Community or something like that and that gives me a lot of uh like that and that gives me a lot of uh like that and that gives me a lot of uh new support including the uh integrated new support including the uh integrated new support including the uh integrated solution Explorer test Explorer and solution Explorer test Explorer and solution Explorer test Explorer and stuff like that so that's cool let's stuff like that so that's cool let's stuff like that so that's cool let's take a look at take a look at take a look at our uh project I can look at that if I our uh project I can look at that if I our uh project I can look at that if I want to in the file view so I can switch want to in the file view so I can switch want to in the file view so I can switch between the file view and the solution between the file view and the solution between the file view and the solution Explorer view you can see here that I'm Explorer view you can see here that I'm Explorer view you can see here that I'm targeting net targeting net targeting net 6 now I could just kind of go YOLO and 6 now I could just kind of go YOLO and 6 now I could just kind of go YOLO and change that to uh net 8 uh and then change that to uh net 8 uh and then change that to uh net 8 uh and then maybe just run around and chase things maybe just run around and chase things maybe just run around and chase things but there is a thing called the net but there is a thing called the net but there is a thing called the net Upgrade Assistant and the net Upgrade Upgrade Assistant and the net Upgrade Upgrade Assistant and the net Upgrade Assistant is a uh either a command line Assistant is a uh either a command line Assistant is a uh either a command line tool or a tool that you can use inside tool or a tool that you can use inside tool or a tool that you can use inside of Visual Studio I kind of like this CLI of Visual Studio I kind of like this CLI of Visual Studio I kind of like this CLI or the command line tool so I'm going to or the command line tool so I'm going to or the command line tool so I'm going to use that uh what I'm going to do is go
-
use that uh what I'm going to do is go use that uh what I'm going to do is go back to my command line here and I'm back to my command line here and I'm back to my command line here and I'm going to say upgrade assistant. upgrade going to say upgrade assistant. upgrade going to say upgrade assistant. upgrade you can see here that I installed it you can see here that I installed it you can see here that I installed it first with tool install. net toinstall first with tool install. net toinstall first with tool install. net toinstall DG for Global Upgrade Assistant I'm DG for Global Upgrade Assistant I'm DG for Global Upgrade Assistant I'm going to say Upgrade Assistant dot this going to say Upgrade Assistant dot this going to say Upgrade Assistant dot this is an interactive process and this is is an interactive process and this is is an interactive process and this is kind of cool it's going to pop up um kind of cool it's going to pop up um kind of cool it's going to pop up um this menu and I can pick do I want to go this menu and I can pick do I want to go this menu and I can pick do I want to go from 6 to 7 or 6 to 8 or even net 9 from 6 to 7 or 6 to 8 or even net 9 from 6 to 7 or 6 to 8 or even net 9 which would be a preview version that's which would be a preview version that's which would be a preview version that's going to come out later I'm going to going to come out later I'm going to going to come out later I'm going to pick net 8 I appreciate that it actually pick net 8 I appreciate that it actually pick net 8 I appreciate that it actually calls out the support dates which I calls out the support dates which I calls out the support dates which I think is cool so I'm going to go ahead think is cool so I'm going to go ahead think is cool so I'm going to go ahead and hit and hit and hit yes and let's take a look actually no yes and let's take a look actually no yes and let's take a look actually no I'm going to hit control C you know what I'm going to hit control C you know what I'm going to hit control C you know what I should do first um because I'm on the I should do first um because I'm on the I should do first um because I'm on the main branch right and that's janky so um main branch right and that's janky so um main branch right and that's janky so um let's go and do a um a net um let's we let's go and do a um a net um let's we let's go and do a um a net um let's we do a get checkout this is actually a do a get checkout this is actually a do a get checkout this is actually a cool thing I've added the um GitHub cool thing I've added the um GitHub cool thing I've added the um GitHub co-pilot command line stuff I've co-pilot command line stuff I've co-pilot command line stuff I've actually wrote about this on my blog a actually wrote about this on my blog a actually wrote about this on my blog a while back get uh AI while back get uh AI while back get uh AI Hanselman uh I think we called it GitHub Hanselman uh I think we called it GitHub Hanselman uh I think we called it GitHub co-pilot for CLI power for for co-pilot for CLI power for for co-pilot for CLI power for for Powershell so I downloaded co-pilot for Powershell so I downloaded co-pilot for Powershell so I downloaded co-pilot for the CLI and then I made these um these the CLI and then I made these um these the CLI and then I made these um these little function these little aliases so little function these little aliases so little function these little aliases so when I type get with a question mark and when I type get with a question mark and when I type get with a question mark and I go get mhm it's actually going to call I go get mhm it's actually going to call I go get mhm it's actually going to call the GitHub co-pilot CLI so if I forget the GitHub co-pilot CLI so if I forget the GitHub co-pilot CLI so if I forget for example how to make a new branch
-
for example how to make a new branch for example how to make a new branch make a new branch called. net8 and make a new branch called. net8 and make a new branch called. net8 and switch to switch to switch to it it's going to ask co-pilot it's going it it's going to ask co-pilot it's going it it's going to ask co-pilot it's going to go and run that command so then it to go and run that command so then it to go and run that command so then it just ran get by typing good uh which is kind of cool by typing good uh which is kind of cool I like to put the little there which is I like to put the little there which is I like to put the little there which is nice now now let's run the Upgrade nice now now let's run the Upgrade nice now now let's run the Upgrade Assistant it's always nice to do things Assistant it's always nice to do things Assistant it's always nice to do things on another Branch isn't it net 8 say yes on another Branch isn't it net 8 say yes on another Branch isn't it net 8 say yes just going to go and take a look at my just going to go and take a look at my just going to go and take a look at my project it's going to go and take a look project it's going to go and take a look project it's going to go and take a look at some stuff now we'll say get uh at some stuff now we'll say get uh at some stuff now we'll say get uh status you can see that it modified that status you can see that it modified that status you can see that it modified that CSR right there CSR right there CSR right there and then I could and then I could and then I could say get diff you see that in this case say get diff you see that in this case say get diff you see that in this case all it actually ended up doing was all it actually ended up doing was all it actually ended up doing was updating that to net 8 so this project updating that to net 8 so this project updating that to net 8 so this project is pretty much just a razor Pages is pretty much just a razor Pages is pretty much just a razor Pages project so doing that did not require a project so doing that did not require a project so doing that did not require a lot of changes I'm going to actually now lot of changes I'm going to actually now lot of changes I'm going to actually now type net build now I use Visual Studio I type net build now I use Visual Studio I type net build now I use Visual Studio I tend to go control shift b control shift tend to go control shift b control shift tend to go control shift b control shift B it's it's a chord it's a hotkey that's B it's it's a chord it's a hotkey that's B it's it's a chord it's a hotkey that's in my hands so I actually made a control in my hands so I actually made a control in my hands so I actually made a control shift B um hotkey in Powershell uh again shift B um hotkey in Powershell uh again shift B um hotkey in Powershell uh again nerd so if I go and look for uh net
-
nerd so if I go and look for uh net nerd so if I go and look for uh net build you can see here that it's build you can see here that it's build you can see here that it's actually a PS readline key Handler so actually a PS readline key Handler so actually a PS readline key Handler so when I type control shift B which is when I type control shift B which is when I type control shift B which is again built into my hands it actually again built into my hands it actually again built into my hands it actually inserts uh net build directly into the inserts uh net build directly into the inserts uh net build directly into the command line which is one of those command line which is one of those command line which is one of those stupid little fun uh life helpers little stupid little fun uh life helpers little stupid little fun uh life helpers little little little sprinkle so I just hit little little sprinkle so I just hit little little sprinkle so I just hit control shift B it types. net build that control shift B it types. net build that control shift B it types. net build that lets me confirm it I'm going to go ahead lets me confirm it I'm going to go ahead lets me confirm it I'm going to go ahead and just net clean just because I'm and just net clean just because I'm and just net clean just because I'm paranoid net build that builds then I'm paranoid net build that builds then I'm paranoid net build that builds then I'm going to go into I'm going to uh go into going to go into I'm going to uh go into going to go into I'm going to uh go into the bin folder I'm going to push the the bin folder I'm going to push the the bin folder I'm going to push the current directory onto the stack so I current directory onto the stack so I current directory onto the stack so I can come back here and I can see that can come back here and I can see that can come back here and I can see that there's a bin debug. net8 that just got there's a bin debug. net8 that just got there's a bin debug. net8 that just got built which is hot then I'm going to go built which is hot then I'm going to go built which is hot then I'm going to go and type pop D which brings me back to and type pop D which brings me back to and type pop D which brings me back to that folder and then I could go andet that folder and then I could go andet that folder and then I could go andet run I could also hit control F5 if I run I could also hit control F5 if I run I could also hit control F5 if I wanted to uh we'll go ahead and run this what where what directory is this coming what where what directory is this coming on oh there you go cool there it is looks like it is looks like it works now I will go and do a little commit upda into will go and do a little commit upda into net oops let me make that bigger for net oops let me make that bigger for net oops let me make that bigger for you get you get you get commitm updating to net
-
commitm updating to net commitm updating to net 8 um I'm not going to push it I'm going 8 um I'm not going to push it I'm going 8 um I'm not going to push it I'm going to then do a to then do a to then do a get check out Main and then do get check out Main and then do get check out Main and then do a get merge. a get merge. a get merge. net8 that's over here now I can see net8 that's over here now I can see net8 that's over here now I can see right here that I've got something to right here that I've got something to right here that I've got something to push now push now push now when I push it though who's going to when I push it though who's going to when I push it though who's going to build it and is it going to break it's build it and is it going to break it's build it and is it going to break it's absolutely going to break so I got to absolutely going to break so I got to absolutely going to break so I got to check two things now what I can do is check two things now what I can do is check two things now what I can do is I'm going to check um where I'm building I'm going to check um where I'm building I'm going to check um where I'm building it now in in my case I build still in um it now in in my case I build still in um it now in in my case I build still in um Azure devops you could build in Azure Azure devops you could build in Azure Azure devops you could build in Azure Azure devops or you could build in Azure devops or you could build in Azure devops or you could build in um GitHub actions so over here in Azure um GitHub actions so over here in Azure um GitHub actions so over here in Azure devops you can see that the last time I devops you can see that the last time I devops you can see that the last time I built this website was was couple three built this website was was couple three built this website was was couple three weeks ago um I've got actually my weeks ago um I've got actually my weeks ago um I've got actually my website and my blog and my podcast all website and my blog and my podcast all website and my blog and my podcast all up there at the same time I I keep these up there at the same time I I keep these up there at the same time I I keep these because I like to you know show people because I like to you know show people because I like to you know show people these different uh reality real real these different uh reality real real these different uh reality real real things these are these are things these are these are things these are these are representative of reality the this one representative of reality the this one representative of reality the this one uses uses uses yaml okay uh so in the in the example of yaml okay uh so in the in the example of yaml okay uh so in the in the example of when I updated this one I can actually when I updated this one I can actually when I updated this one I can actually go in there and look at that Pipeline go in there and look at that Pipeline go in there and look at that Pipeline and this pipeline is a yaml and this pipeline is a yaml and this pipeline is a yaml pipeline pipeline pipeline and it looks like and it looks like and it looks like this okay so here I had to say use net 8 this okay so here I had to say use net 8 this okay so here I had to say use net 8 in
-
in in yaml and then I also needed to go into yaml and then I also needed to go into yaml and then I also needed to go into um Azure when I updated my podcast go um Azure when I updated my podcast go um Azure when I updated my podcast go into into into configuration and then for the app configuration and then for the app configuration and then for the app service that I'm running in I need to service that I'm running in I need to service that I'm running in I need to change my versions I need to do the same change my versions I need to do the same change my versions I need to do the same thing for my main website however thing for my main website however thing for my main website however um over here in devops on this machine um over here in devops on this machine um over here in devops on this machine on this website rather pardon me this on this website rather pardon me this on this website rather pardon me this pipeline is an old style pipeline this pipeline is an old style pipeline this pipeline is an old style pipeline this is the old is the old is the old visual pipeline now again everyone's visual pipeline now again everyone's visual pipeline now again everyone's different the point is I'm building on different the point is I'm building on different the point is I'm building on my local machine on net 8 I need to make my local machine on net 8 I need to make my local machine on net 8 I need to make sure I'm building in the cloud on net 8 sure I'm building in the cloud on net 8 sure I'm building in the cloud on net 8 as well so I'm going to go over here I'm as well so I'm going to go over here I'm as well so I'm going to go over here I'm going to change it to uh net core8 cool sure I could look at the the core8 cool sure I could look at the the ml underneath that if I felt like it as ml underneath that if I felt like it as ml underneath that if I felt like it as well confirm our version do a restore do well confirm our version do a restore do well confirm our version do a restore do a build then it's going to go and a build then it's going to go and a build then it's going to go and publish it publish that artifact cool publish it publish that artifact cool publish it publish that artifact cool let's go and let's go and let's go and save updating to. net8 it's using ubon save updating to. net8 it's using ubon save updating to. net8 it's using ubon to save and to save and to save and run okay so that's going to start run okay so that's going to start run okay so that's going to start running that job now however on the running that job now however on the running that job now however on the other side what's waiting for it is other side what's waiting for it is other side what's waiting for it is azure which is currently not not ready azure which is currently not not ready azure which is currently not not ready because I didn't update now if I wanted because I didn't update now if I wanted because I didn't update now if I wanted to be super fancy this was a production to be super fancy this was a production to be super fancy this was a production website I'd have staginghome and.com and website I'd have staginghome and.com and website I'd have staginghome and.com and then over there I then over there I then over there I would uh have one on six and one on
-
would uh have one on six and one on would uh have one on six and one on eight I'd have them fronted by something eight I'd have them fronted by something eight I'd have them fronted by something like Azure front door and I'd go and do like Azure front door and I'd go and do like Azure front door and I'd go and do some AB testing before but uh you know some AB testing before but uh you know some AB testing before but uh you know when I uh do things I do things in when I uh do things I do things in when I uh do things I do things in production okay I'm going to change this production okay I'm going to change this production okay I'm going to change this from net 6 to net 8 hit save that's from net 6 to net 8 hit save that's from net 6 to net 8 hit save that's going to going to update my web app so going to going to update my web app so going to going to update my web app so I'm telling it to run this in net 8 now I'm telling it to run this in net 8 now I'm telling it to run this in net 8 now of course if I was using a of course if I was using a of course if I was using a container I'll show you that actually in container I'll show you that actually in container I'll show you that actually in just a little bit I would update the just a little bit I would update the just a little bit I would update the container to run a little bit container to run a little bit container to run a little bit differently So currently on the net uh 8 differently So currently on the net uh 8 differently So currently on the net uh 8 website here I think on the on the website here I think on the on the website here I think on the on the Hanselman website if we scroll down at Hanselman website if we scroll down at Hanselman website if we scroll down at the very very bottom it's powered the very very bottom it's powered the very very bottom it's powered bynet six I'm going to hit bynet six I'm going to hit bynet six I'm going to hit refresh and see it has not yet updated refresh and see it has not yet updated refresh and see it has not yet updated yet okay it's on net 6 yet okay it's on net 6 yet okay it's on net 6 still now the application is updating still now the application is updating still now the application is updating little bit I hit it in I was going little bit I hit it in I was going little bit I hit it in I was going refresh refresh refresh refresh refresh refresh refresh refresh refresh refresh refresh refresh refresh refresh refresh so it looks like I made it mad looks so it looks like I made it mad looks so it looks like I made it mad looks like this job has finished the release like this job has finished the release like this job has finished the release is happening right now in is happening right now in is happening right now in progress okay remember I said I should progress okay remember I said I should progress okay remember I said I should uh publish to staging instead of uh publish to staging instead of uh publish to staging instead of publishing to uh production there you go publishing to uh production there you go publishing to uh production there you go it's done let's go back we'll hit cool let's go back over here8
-
cool let's go back over here8 do8 I think I saved it oh that's it oh that's interesting that's a oh there we go just interesting that's a oh there we go just interesting that's a oh there we go just updated. net core 8 that's cool wanted updated. net core 8 that's cool wanted updated. net core 8 that's cool wanted to make sure that looks like it said six to make sure that looks like it said six to make sure that looks like it said six there for a [Music] [Music] second oops wrong second oops wrong second oops wrong window too many window too many window too many [Music] windows okay cool this is great so now windows okay cool this is great so now we are not working let's go find out we are not working let's go find out we are not working let's go find out why this is interesting because when I why this is interesting because when I why this is interesting because when I did it in on my podcast site it worked did it in on my podcast site it worked did it in on my podcast site it worked just like that so I've obviously just like that so I've obviously just like that so I've obviously forgotten something confirming that it does in something confirming that it does in fact fact fact run handshake handshake site does site does site does load locally deployed right making sure I
-
locally deployed right making sure I didn't forget anything in my didn't forget anything in my didn't forget anything in my pipeline 8 8X 8X 8X cool let's look at pipeline 8 8X 8X 8X cool let's look at pipeline 8 8X 8X 8X cool let's look at the pipeline log oh hang on a second I'm in oh hang on a second I'm in dork I didn't push the darn dork I didn't push the darn dork I didn't push the darn thing all right friends like why is it thing all right friends like why is it thing all right friends like why is it not working I never I never pushed it what am I doing there we it what am I doing there we go so go so go so okay let's go back here there's the okay let's go back here there's the okay let's go back here there's the push let's click on it there we go how push let's click on it there we go how push let's click on it there we go how did I did I did I know I was using that last one so funny know I was using that last one so funny know I was using that last one so funny that's what happens when you try to rush that's what happens when you try to rush that's what happens when you try to rush and do stuff in one take there we go now and do stuff in one take there we go now and do stuff in one take there we go now notice here that's installing net core notice here that's installing net core notice here that's installing net core inside inside inside of uh the uh the Azure devops job of of uh the uh the Azure devops job of of uh the uh the Azure devops job of course again this could be done in uh in course again this could be done in uh in course again this could be done in uh in GitHub actions or you know whatever GitHub actions or you know whatever GitHub actions or you know whatever makes you happy do the makes you happy do the makes you happy do the build and in this case the publish is a build and in this case the publish is a build and in this case the publish is a publish artifact publish artifact in publish artifact publish artifact in publish artifact publish artifact in this case I'm going to publish a zip this case I'm going to publish a zip this case I'm going to publish a zip file there you go publish and then the file there you go publish and then the file there you go publish and then the release is going to start so over here release is going to start so over here release is going to start so over here where it says release that was a failed where it says release that was a failed where it says release that was a failed release there you go here's the new
-
release there you go here's the new release there you go here's the new one it's queued up sitting on Azure pipelines there it go it's taking that pipelines there it go it's taking that zip file and it's publishing it to uh to zip file and it's publishing it to uh to zip file and it's publishing it to uh to Azure and of course I could go back over Azure and of course I could go back over Azure and of course I could go back over here and look at the deployment here and look at the deployment here and look at the deployment Center we can see those deployments Center we can see those deployments Center we can see those deployments because I've integrated that inside because I've integrated that inside because I've integrated that inside of azure see you can your app is of azure see you can your app is of azure see you can your app is configured with Azure pipelines right configured with Azure pipelines right configured with Azure pipelines right hit logs see those logs there you go hit logs see those logs there you go hit logs see those logs there you go deployed succeeded why did I deploy the succeeded why did I deploy the production idea there it is because it's there idea there it is because it's there scroll to the scroll to the scroll to the bottom there you go it bottom there you go it bottom there you go it worked all right site is deployed on.net worked all right site is deployed on.net worked all right site is deployed on.net core core core 8 saw it 8 saw it 8 saw it there there there confirmed confirmed confirmed here and confirmed on the page
-
itself right there itself right there cool so other than that little hiccup cool so other than that little hiccup cool so other than that little hiccup where where where I failed to push it to the uh the I failed to push it to the uh the I failed to push it to the uh the cicd pretty straightforward hope this cicd pretty straightforward hope this cicd pretty straightforward hope this helps you upgrade your site to don8
Summary
The main theme is upgrading a personal website to the latest long-term support version of .NET, specifically .NET 8. Key references include .NET 6, .NET 8 LTS, and using Visual Studio Code with the C# Dev Kit. The practical takeaway is that upgrading to .NET 8 is beneficial due to new features, performance improvements, and extended support, with minimal downside.