Keynote: The Future of Modern Application Development with .NET and Azure

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
yes i put a slide in i never put these slides in but i put this in for fun um so i was actually born in little rock arkansas thank you uh graduated from little rock central high uh and then i moved to california to work for two startups mustang software and starbase and then i joined microsoft in 2007 and i have to pinch myself every time i think about this because i run the pm team at microsoft for the languages runtimes and frameworks and there might be some things on the list here that that shock you a little bit if you know me uh yeah obviously c sharp f sharp.net core asp.net but there's java and c plus plus there um which is kind of weird.net guy java but we'll talk more about that so the joke as i think about my my job um i i when i joined microsoft i worked on c sharp i probably should have worked on java because we had this thing called visual j plus plus in 1997. um but we weren't good in open source back then so uh you know we kind of made it a custom microsoft java where we uh didn't do some of their features and we added some of our own features um and we got sued um and we had to rip it off all the machines uh now the interesting thing is there's something in there called dub dub fc which was windows foundation classes and that is the genesis of actually what is called winforms.net um basically we took some of this tech we wrote a new language uh and we shipped it as dot net um and so instead of doing java you know i built c sharp tools um and uh you know done that's old uh deception 2002 lots of languages um you know all about windows and the web and that was it now we are also a funny company you know i said we already the java thing was not a good thing um and even.net we did some some weird stuff we uh we did this thing microsoft plans the sharedsource.net and there's none of that code in actual.net um it was actually a weird one-off thing meant for educators but it was it was not good open source because as i said there's not a single line of code probably in that thing it's actually in the real.net um so that was not good um but you know we were pretty successful and i'm gonna make fun of this next slide in a second too so this is um this is a slide that i got from our marketing team maybe six years ago 1.8 billion installs 64k embedded systems all this stuff uh six million professional developers uh the funny thing about that number is we didn't know how to count then um so let's go forward in 2008 we took it a step further and we open sourced the first parts of.net uh this was mvc 2008 it was the one of the first projects that i worked on and of course because we're microsoft we can't use like any of the popular open source licenses we make our own microsoft mspl um good news is it actually was a good license it's not a bad license today we do all of our stuff either with apache or mit but that was actually not a bad license it just felt weird because we had to make one and uh you know you could download the source code you could redistribute um but we didn't take contributions from the public um richard richard and i talk all the time about the work it took uh to convince our legal team uh to let us actually take contributions which took four more years um and so in 2012 we really open sourced the tech um we did you know asp.net web stack entity framework all the parts of the web stack that i worked on at the time because i was part of the asp.net team we open sourced and you can see it was amazing on codeplex because we couldn't do github and so we were still partially there um and you can see we actually put a proper apache license on these things uh you can distribute the source code um i wouldn't even describe what ms opentech was it was a way to do open source and a company that wasn't ready to do open source yet uh but it was it was a path and it was a way and we helped uh the rest of microsoft be able to start their journey towards that um and this is my favorite thing you know when you when you have a successful product what do you do you make lots of them um this list is actually embarrassing to me dot net framework compact embedded silverlight phone seven eight uh um and so if you're me you know if you don't know anything about me i'm scott and i work for scott guthrie who's the evp of azure uh and and other stuff um and so as a scott i have to make another one um and so in 2016 uh we we introduced net core which was the next generation of.net meant to take people to the next level and it was meant to be everything.net framework was not fully open source cross-platform full command line support all those things um and that's kind of where we are today and and where we're at um and this time we really open sourced all of it with full contributions and we're one of the highest velocity oss projects on github today and this is just a pile of different moments in time that we open source stuff and i gave up trying to update this anymore because we're so open now it doesn't really matter um but that's kind of the dot-net journey and there's something else funny about this too is um we ship java again just a few weeks ago at build our developer conference um we now build an open jdk and we build that because we want to make sure that if you're a java developer you have a free runtime you can use oracle in a couple years ago started charging developers for using java and guess what even though we're a big.net company we have things like minecraft linkedin synapse and azure all built on java and so java is important both to us and to our customers and i i pinch myself being able to get a chance to work on not just.net but java and c plus with that let's kind of go back to where we are now and uh today we kind of live in this world that.net framework world only did desktop and the web there was no cloud mobile gaming iot or ai um those all came later um a lot of folks even recognized some of this like xamarin uh that's a company we bought in 2016 that's where the mobile came from cloud came from me uh in 2010 scott goo pulled us out of developer division and brought us into azure and so we were there working on some of this stuff if you've ever run on your phone uh any app that says unity that's a net game under under-appreciated that how much.net there is in gaming uh with the.net core we actually started working other processors and stuff and enabling iot um and we took an open source library inside of microsoft that we use for a lot of our tools for machine learning and we uh we contributed to net as well and so now you can build all these types of apps and net um this is where it's fun now look at my number here we have greater than five million dot net developers and visual studio uh family of tools well what was the six million before did we lose a million um the reality is back in the day when we actually made that other number we measured our success based on the number of downloads of our product today we actually measure success based on you downloaded it you installed it and then you actually used it and so the number today is more accurate but i'm happy to say that sometime this year we will hit that six million number again but this time for real and just to give you an idea if you're thinking about how bigger developer ecosystems the estimate is estimate is that java's about 10 or 11 million um and so i i think the five five to six million we have is amazing number one love most framework on stack overflow two years in a row uh the the one on the right here the top 30. um there's you can't see the fine print here but the cloud data foundation they monitor a bunch of open source projects and looking at how many pr's and how many issues and how many comments uh are accepted on on those technologies and net is currently the number one project on github on that measurement um and that's because a lot of the contributions.net are no longer from us um and and that i i can't can't imagine that um ten times faster than node.js if there's any node people in the room i'm sorry um uh this is this is the perf stuff that we that we talk about so as we started reinventing.net we have to ask ourselves well why would anybody want to use net you know back in the day it was like hey if you want to run on windows you write a dotnet application but in this new world of all the devices linux the cloud why would you want to use net and so as we started reinventing.net we said hey let's focus on performance let's make net the most performant we can we can be um and so this is showing a benchmark called the tekken power benchmark there's a bunch of of these that they run this is showing plain text which is not the most real benchmark but we have seen all these changes we make for performance actually affect real world applications there are plenty of services inside of microsoft in azure that have seen 20 25 improvements uh in performance and cost um as they move to the newer tech that we have um on the right side you can see uh grpc which is something we shipped a couple years ago in net um it's a modern messaging uh framework and you can see that as we were getting to ship.net five um faster than java faster than c plus plus faster than go um just a little bit slower than rust but that was actually running a pre-release version of five uh these aren't our benchmarks so we have to wait for them to run them the the open community uh to see what actually happens here and so that is our our commitment is to make.net so fast that uh you know it runs better in the cloud for you this is fun too as somebody worked on.net framework i remember having customers call me and they're on like the version that's six years old uh and they're like scott hey what happens if we actually upgrade our server with the new version will it break the app so we had this problem in.net that nobody used the new versions they stayed on the old ones forever and forever and so with with.net core 3.1 when we shipped it in the first six months of use we had three million people switch to it or at least use it along with one of the older versions as well we ship.net five we had 3.6 million people start using it within the first six months and so this makes me very happy as a developer people are using our latest bits the latest technology the latest stuff and not waiting five six seven ten years uh to upgrade and that's something i would ask any of you if you're if you're using this tech get on the newest versions um all the time um and this this kind of comes down to you know why uh dot net five so if you don't know we actually rebranded.net core we took the core out of it uh and we went back to justine.net and we did that because we want to make it very clear to our customers that this is the future the new tech is dotnet 5.06 uh whatever and we give you flexible deployment this solves that problem i said before about.net framework you can have all these versions on the computer at the same time nothing breaks um unparalleled performance that really is the the key of our our tech and uh you're going to see in dot net six we want to fix the other part of of performance which we have which is what we call inner loop and i'll discuss that in a little bit more obviously with that performance better hosting costs and less infrastructure required to run your applications and then the last line is really more about keeping everything up to date with the latest language features and stuff like that we're evolving c-sharp f-sharp um at a faster rate than we ever have we now ship new versions of each of those every year and so you know if you want those benefits you need to be on the on the latest versions of the tech um this is something that uh uh does anybody in the room have any dot-net framework projects a few hands um so one of the things that people have asked us for forever is hey how do you actually upgrade an application faster and so we actually have a bunch of us at microsoft that actually take some of our internal teams that are running their services in azure on.net and help them move we've helped some external customers as well and so we took all the learnings from that this was a tool that we built for ourselves and it's now available today uh you can grab it and it will try to help port your application it'll convert your project files it'll fix your package references uh it'll do some code fix ups and stuff like that and it'll back up your code first obviously but it's a great way to if you have net framework applications you want to look at moving forward it's a great way to try to do that now where are we going uh dot net six uh that's the release the version of dotnet we're gonna ship this year and it's actually the something i've talked about for a long time that we've actually finally come together into a into a single platform um so as we move from saying.net you know core 31 or whatever to.net five um we still haven't put all of it together if you look at things like xamarin that's the mobile tech that we have in dot net well it's a it's a check box it's not it doesn't use the same project system as dot net core did it didn't use the same command line tools we've now simplified all this down into one thing we're going to have a single sdk that you install and you can build all those app types i showed earlier um we're going to make the sdk something that's that's not huge either you can actually opt we call these optional workloads so the xamarin tech which will be called maui you can just decide to install it manually one vcl this is crazy we had the.net framework bcl and for bcl that's base class libraries that's strings and date times and networking and all that stuff we had three versions of this the net framework one the one in.net core and the one in mono which ran the xamarin technologies we've consolidated all that down into into a single platform now so there's only one set of those no matter what app type you build it's the exact same dcl and we have a unified tool chain as well there's a command line tool called.net and it can build and run all these applications um people have asked for this for a long time uh we're bringing cross-platform native ui this means you can build a single app and it will run on mac windows ios and android and i'm sure people are saying well what about linux let me ship the first four platforms first and we can see if linux actually there's enough demand for linux um obviously the web is cross-platform uh but i say cross-platform web ui because we also are going to let you build electron style applications these are desktop applications that use dot net blazer inside of them and so you can build a web app that can still access the local file system local resources it could load native dlls if it wanted to um and so we think we're not only going to have our regular web tech but we're making it work even tighter with the hardware um cloud native investments you know we think we're one of the best platforms for building microservices and i'll show some cool stuff uh in one of the demos that talks about that and then of course what we find is about every version of.net so far we get about 10 to 15 to 20 percent more performance and a lot of the common apis and so this will continue again uh in net six you know we get the chance to run this tech on huge workloads at microsoft which helps us actually uh uh work on that so what are the big features in dot net six um we have uh a bunch of features in c sharp that let you write less code less type casting less stuff super exciting to see some of that stuff we have dot-net multi-platform app ui who can come up with better acronyms than that which we just called.net maui but that is cross-platform windows mac android ios um single app all those all those places and you'll see some demos of that blazer you can now build laser on the desktop with full access to your machine uh we have minimal web apis if you compare like an asp.net application to something like express and node we look more complicated well that's because we we built for thousands of apis not five or ten now we do both um we've added more support for new chips um apple m1 support is there now and all of our desktop frameworks the older desktop frameworks now run on windows arm 64 as well and then i think the biggest one which is too far down this list is hot reload and i'll show a video of hot reload and i'll do a demo of it on my machine in a second as well because i think it's uh it's amazing this is a funny one too um talk about performance uh entity framework has been this orm we've had on.net for a long time i think the first version shipped in 2008. um we now have a core version of that as well but people always say you know orms are expensive they're big they use too much memory they're slow uh the the fastest lightweight data access platform on.net is something called dapper and it's by the folks over at stack exchange they run it to make stack stack overflow work in.net 6 ef core is as fast as dapper so we have we have we are now as fast as the lightest weight data access library uh on.net you can see here 70 performance gain version diversion um 31 faster query performance and up to 43 reduced memory footprint speed comes by not allocating memory um and so i'm super super excited to say you can have all that perform all those features in ef core um but get the same performance you would would on the on the most lightweight uh orm that's out there which is dapper in fact we've actually the dapper folks uh are off to go redo dapper now uh to try to make it faster again which is it's great for us to have this kind of fun back and forth with some of the the folks in the open source um this is uh some of the stuff we're doing in c sharp and i'll i'll really highlight some of this in a second we have something called global usings uh which get rid you can see here global using system you can define global usings and then i have to put those in every file in your application less junk um uh improvements to lambdas i'll show some code in a second where you can see where if you're using lambdas before you had to type cast a lot of times that looks bad so we're getting rid of that and we're continuing to go take some of the new record work we did in dot net 5 and and continue to enhance it uh we can more easily define a class with less less less markup so this is a uh this is what we call minimal web apis and this is the you can write a net web api with this many lines of code three lines of code now and so this is a super lightweight single file built for cloud native apis if you have a thousand apis you probably should still use our controller model but if you just have five six apis this is a great simple way to build these apis in very little amounts of code you can see this is this is actually the entire app you might say well where's the main well we have added a feature in.net 5 called top level programs no mains required we added a feature in.net six called global usings which got rid of all the usings and you really can get down to this concise code that you see here if you want you can easily take one of these and port it into our controller tech if you want to have a lot of apis and manage them easily and this is going to be available with dotnet 6 and so let's do a demo of this so some of the demos today i i it's this is kind of weird uh we were getting ready for the build conference which was at the end of may and uh they came to us and said hey we want you to record all these things a month in advance um and we weren't ready we actually weren't even ready for bill to be honest with you and so three of the demos i have today are actually videos that we produced at build um and i just can't bring five laptops uh to the show it's too much uh so i just have videos of them but i'll show some of the hot reload stuff at the end in in in real demos so let's try this i am super excited to show you asp.net minimal apis we first introduced webapism.net back in 2012 with the web api project built on top of mvc which uses controllers routing attributes conventions dependency injection and more to let you build enterprise class apis on.net and we've carried all that technology forward to.net six but we see a new trend around lightweight apis and small microservices and some new frameworks like express and node luminant php fast api and python make these super easy to build minimal apis we want to enable you to build the same lightweight apis using the same asp.net that you know and trust with less configuration and a path to upgrade to controller apis if needed to do this we're using a bunch of new technologies look at this application using top-level programs there is no class or main it's just code using a lambda i can write the function inline next to my route and if i run this you can see that my three line application can return hello world to the browser we think these new lightweight apis are going to make it easier for you to build microservices we think it's going to be make it easier for new people to learn and build their first apis and net so i'm super excited about this but i want to take this to the next level and show you a real api so let me go back to visual studio here we are back in visual studio and in this case i've got three api projects my minimal web api project hosted in azure uh the power's the rest of the demos you'll see today i've got my mvc web api project here as well and i've got an express application written in node let's start off with the mvc web api and you're going to see it's got a bunch of files startup.cs program.cs and it's got its weathercontroller.cs let's dive into the weather controller and you're going to see these apis are based on classes that then have methods with attributes on them great for building lots of apis but if i just want to build one api i can go look at something like the express application here and look it's very concise down to 37 lines of code to build a single api gets right to the point now if we move over to the new asp.net minimal api you're going to see it's even smaller and more concise than the express application 30 lines of code and this is because we're using new features like top-level programs global using lambdas to really reduce the amount of ceremony you have to do to write a single api this kind of technology is great for building microservices and simple apis now as i looked at this i uh i wanted to compare all the technologies to each other and so what i've got down here is i've got a notepad file and i've kind of kept a tally of how much code you have to write so the mvc web apis that's really if you want to build a lot of apis that requires about 138 lines of code to get started the node express api uses 37 lines of code and amazingly enough you know net minimal apis are only 30 lines of code and this is just showing you we're applying these new technologies to make it faster and easier for you to build great app so here we are back in visual studio and now what i want to do is run my app locally to make sure it works here we go and you can see it's pulling the weather back and so i've got a successful api using asp.net minimal apis running now the next thing i want to do is switch back to visual studio here we go and what i want to do is i want to publish this application to azure for the rest of the demos that you see today so i'm going to click publish we'll select azure and we'll select app service linux there we go let me create a new one i'm going to change my name just to minimal weather i've got a hosting plan already set up for me i will select that press create here there we go it's creating my app service um now i'm going to click next and i'm actually going to deploy using github actions using ci cd and click finish what happens now is when i commit my app it will do a ci cd flow to publish it i can switch to my repo and you can see all the steps have happened to publish my app to azure and now i can actually go and open my browser tab here and this shows the minimal api that we built running in azure and we will use this for the rest of demos today so that is minimal apis and uh some of the inspiration for that was maria nagaga on our team uh who joined our team not as a net person and was like wow you know getting started in.net is hard building these controller apis is so much more complicated than the examples you see in python and and uh node.js and such like that and so we built language features uh to enable this and this is all using the same asp.net tech it's it's the same tech that powers the controller apis it's just a more simple concise way to do it for people to want that so uh um very very cool about that the api we built there was a weather weather api and then all the other demos i have here use these exact weather api so the next one we have is net multi-platform app ui or really.net maui and uh what this is is this is a platform for building cross-platform cross-platformnativeui with.net notice here that on windows we use windui when ui is the newest tech built in the windows operating system windows 10 for building gui applications uh on on the mac we use something called mac catalyst mac catalyst is an api or a library on the mac that's designed to make it easy to move an ios app to the mac apple themselves uses mac catalyst for many of their apps like news and so on on the mac and so this is the same tech apple's using to build their apps uh which makes it very easy for you to build apps that run on the mac and then of course for ios and android we use the native libraries on each of those devices as well so we have all four of these supported um not only that if you've ever used the xamarin technology we had in the past um it actually has a project for every one of your deployments so we'd have four projects here um and so we are going to condense that down you have one project that supports all these four app types one single code base write once run everywhere and you can deploy to multiple devices you just right click on the application and tell us where you want to build a deployment for and we'll do that for you and this will ship in.net 6 as well and this this is this is exciting tech not only can you do this but the the one one of the neat aspects of maui is you can also make your apps work better on the native platform so the demo i'm about to start we will build a maui app which is kind of a common app that runs the same way on every platform and then we will enhance it so if you run it on windows or a mac um you're getting all the the things you would expect it can do native notifications it can do right-click menus i can do task bars and stuff like that so uh let's do a demo of this as well dot net 6 brings consistent experiences from all project types to don and maui including the command line in this case we're going to create a new maui app with dot net new maui we're going to name it build maui now from here i could run if i wanted to dotnetrestore.netbuild.netrun but i want to show you how we can build an optimized experience for building cross-platform applications with visual studio so let me launch visual studio here dotnet nowaday targets ios android mac and windows and so what we're going to do here is take the single project here we're going to set this to startup project here and then what i want to do is i'm going to go to the debug menu here and click that again drop that down and select the framework that i want to run on and i'm going to select android here and that means when i run the application it's going to actually run the application on my android emulator on the right here so let's get this started um one of our goals with dotted maui was to give you a single project for building all your applications so you can focus more on your application and less on the specific targets of your application it all starts with the startup.cs file this is very similar to what we do with asp.net today uh this is where you configure all of the things for your application uh in this case we've set on we want xamarin forms compatibility we set our default application we're going to set our font right here and if i'm using third-party libraries i would configure them here as well maybe i'm going to use dependency injection i want to share something across my application i would put that here as well and so that's kind of the way we've copied that experience from asp.net to over here now we have these folders android ios mac catalyst and we have the wind ui three down here and this is where you write your platform specific code we also have a resource folder inside of that we put your fonts your images your app icon your startup screen all in one place and so here the apple application is booting up in my emulator and what i'm going to do is i'm going to go and click the counter here see it's at number five and i'm going to show you how to reload i can actually change either my xaml or my c-sharp and press save and as soon as i do the application updates immediately this helps with your productivity quite a bit now this is a semi-simple application let's use a more complex example and show you how we can do platform specific light up with net maui so here i am in visual studio with my weather application and you're going to see in that uh as i run it here it's a win ui native windows application um but i've done a few things differently here if you look in my configure services i've added some new services i've added a tray icon for putting a tray icon on windows i've added notifications for native notifications and a tree icon for mac now if i go and show my main page here you can see i've what i've done is set up app actions this allows me to put a context menu when you right click on the app icon where you can put some menu items in here and make it do some other options i've also added a tray icon too um and so what happens here if you click on the tree icon we'll send a notification on the platform that you're on uh with that data so if i look here i can right click here my new context menu showing up right here in my applications it's showing native ui hookup here's my tree icon i can click it and there you go you can see as soon as i did that a notification popped up in windows showing how you can do these native light ups across all the platforms now i can't just show you just windows um dotted melodies cross platform let's go to my mac and i'll show you a couple other options here you go i've got my same ui and same code running on ios mac os and android if i resize the mac os application you see it resizes dynamically like you would expect if i click the icon you see those same menu items there you saw before and then if i click the icon at the very top you'll get that notification directly on your mac so this is showing you how we can do this cross-platform light up but still give you these native options with dot net maui all using the same ui so i hope that was cool um i think you know write once run everywhere using the native platform ui on all those apps is a freaking amazing capability and i am super excited about it uh um like i cannot wait to ship this in in uh in november uh the next thing we we thought about was blazer um you know a lot of the apps we use today whether it's slack whether it's vs code these are you know uh what we call electron applications they're um web apps that run in a desktop shell and of course they need that desktop shell so they can talk to like the file system vs code is in file editor it needs to be able to see your file system um and but using web is great because you can use your web and share it across all these different platforms some people just prefer to write their ui and web and so we love to give you that native capability again uh with blazer and so once again you can reuse ui components across native and web uh what i don't say here is you can actually put native controls and a blazer app as well if you want you don't have to just use web you can do a quick mix of web and native controls um this is actually built on top of the thing i just demoed before which is called uh.net maui it's basically.net maui but inside of.net maui you have a in your xaml you reference a blazer project and that will inject the blazer project directly into your application something cool is the blazer project is running in proc with the application which means it is super fast and it has access to the whole device as once again it's a native app container which means it can have native controls as well um and this will ship in.net six uh and you can see right now uh we're primarily targeting windows and mac for this um but it will work on ios and android i just don't know if we're gonna put supported next to those uh in this time frame but the tech is the same text so it should actually work across all those there might be a few limitations on the on the mobile devices if you want to build a web-based app that runs in all those places and then here is a demo of blazer and we're going to start off with the before i start the the the demo we'll start off with just a plain blazer application a web app um and then we'll take that blazer application and wrap it into a native app and then we'll give it those same native hookups that we gave uh the real.net memory app as well because it can take advantage of the the system platform blazer makes it easy to build rich modern web ui here's our weather app implemented as a web app using just html css and net the web app has a nice responsive layout so it looks good on mobile devices as well as desktop screens we can see the current weather and local weather forecasts we can also check out the weather from other locations here's the weather in south korea here we can also change the settings of the app to switch from imperial units to metric units it automatically gets applied to the entire application now all the client-side interactivity in this app is implemented using reusable laser components that work in any modern web browser using just the open web the app calls our azure hosted minimal weather api to get all of its weather data by pairing blazer with an asp.net core server you can build full stack web apps with just.net our weather app can still use some improvements the list of weather stations on the right hand side looks a bit plain in.net 6 we can quickly make changes to our asp.net core and blazer apps using dot net hot reload here's the component that displays each weather station as you can see right now it's got some simple markup let's update the styles for this stack box class save that it gets automatically applied looks nice now let's also add some markup here in order to better lay out the text and maybe add an icon save that with dotnet hot reload our changes get applied to the running app without losing any app state blazer makes building webapps with net fast and fun but sometimes you need more than what the web platform offers by combining blazer with dot-net maui you can reuse your existing web ui logic and web development skills to build cross-platform native apps that can take advantage of the underlying platform dot net maui comes with a built-in blazer web view control that you can use to add existing blazer components to any net maui app this means we can take our blazer components from our weather app and embed them into the.net maui app without having to change anything here is our weather app running on as a native desktop app on windows it looks the same and has exactly the same functionality using the same blazer.net code blazer components hosted in.net maui run directly in the.net process this means they run fast and have full access to the native capabilities of the device through the.net platform for example we can reuse the same system tray integration that you saw previously and trigger native platform notifications because this blazer app is running inside a.net maui app it can run on other platforms too let's switch over to my mac to see how blazer desktop app can run cross-platform all right here is our blazer weather app running as a native mac app as you can see it's got the same look and feel it's got the same functionality if we check out the weather in south korea we can do that there it is and it looks and feels the same because it's the same code that we ran the windows app and also on the web the app also has native integration so we can show the little.net bot up in the menu we can click him and trigger a native notification by building our app as a blazerhybrid app with dot-net maui we get the best of dot net the best of the web and the best of the native platform so that is net maui with blazer um something else that's really cool about that is um these these apps which we've not even worked on on actually optimizing yet are very small in memory footprint um so you know we all know that some of the electron apps uh including teams that i'm running right now uh can end up using a lot of memory uh the uh the native version of the weather app uh was using about 80 megs of ram the blazer version of the same app was using 95 mix of ram so under 100 megs of ram for a real functional application with real ui uh with web and so we think if you're a net developer whether you want to use native ui or you want to use web we have you covered with both of those texts uh you can do more with net now let me define a term um there's a term that we use inside of microsoft and none of you would ever use this term i never heard of it heard of it until i worked at microsoft and we have a term called inner loop and the inner loop is the loop that we as developers do you write some code you run your application you look at it and go yuck you stop the app you change the code again and you reload and you rerun the application that loop of making a change seeing it reflected in your application and then doing it again and again we call that inner loop and so one of our biggest goals in dot net six is to work on the inner loop you know you've seen on the on the benchmarks that net is amazingly fast as a runtime um but our inner loop performance is not good um if you compare it you know compare us to node.js or react app uh or a flutter app uh they just have a much better developer feel um in some ways because some of that tech's not compiled tech it's actually interpreted and so they don't have to restart apps and do stuff like that but this is something we want to fix in.net and we've already made more progress than i ever thought we would have in dot-net 6 and we'll continue with.net 7. you can see just generally across the board just a clean build of a blazer server is less than half of what it was in dot net five uh incremental builds are much faster um and then for mvc applications basically you can see here that even before we even start talking about doing what we call hot reload we've improved this amazingly across all these things so lots of build time improvements and we actually had to stop doing these we we had more uh we can make each of those purple bars a little smaller but we ran out of time even though we're six months from shipping uh we need people to go work on some other other stuff but in dine at seven we'll they can take another hit of this and remove more of this um hot reload and for if you don't know what hot reload means hot reload means you just change your code and the app updates without doing a stop recompile run and we've had parts of this in some tech for a long time we've had edit and continue which worked for winforms and wpf projects and web web forms projects but we want to make this tech work everywhere whether you're building a console app a windows app asp.net app a maui app we want this to work everywhere across all the project types and this is a big thing we don't want to restart your process um so we want the state to maintain so your app you know stays where it was before you saw that in in in the demo of of the blazer desktop stuff and there will be cases where we do have to restart the app but we've actually figured out how to actually restart the app without killing the process uh because processes are expensive in windows um and so we can do that too um and then here's another thing too is if you've ever used edit continue it requires you to use the debugger i never start my.net apps with a debugger i always start with control f5 because it's a faster experience and so we're going to have a new experience where you can actually start this get the hot reload and then if you decide halfway through your session to add the debugger you can and this will this will be an evolution of edit continue um and i'll do a demo of this real quick um all of the stuff i'm showing that i said was undimmable is should be dimmable maybe in a week from now on bits that we're going to release to you folks but here's hot reload for this demo i have two apps to show you first let's start with the wpf app running on the right hand side this is a net six app called boyd's a game of life simulator and you can see many shapes moving around with dot net hot reload we can now change the game logic while the app is running to do that we're going to press this brand new button now let's go ahead and make a change to the app and see how it works i didn't build the app so i'm not sure what changes to make but let's go ahead and change speed limit that seems like it's going to do something so i'm going to go ahead and change that how about we add 10 to it now i'm going to apply the change and as you can see the behavior of the game is changing right away i'm going to undo that i'm going to make a different change i'm going to make a change to the percentage to move towards home not quite sure what that's going to do let me just add 0.1 to that and again i'm going to apply the changes and now you see a dramatic change in the app without having to restart it while it's fun to show you an app like this i now want to go back to our weather app and show you some edits that should feel like real world situations let's switch over to our weather app here's the weather app you've seen in the other demos as you know this is a.net maui desktop application and here too we can apply code changes while the app is running so first i'm going to look at the wind indicator i expected some simulation code had been added to make the indicator move let's go and see go ahead and see what happened we go look at the code and find there's a to do here instead of stopping the application i'm just going to go ahead and add the code that i would have expected to be here i'm going to add a get direction which gives me some random directions i'm going to change it so it applies direction icon and i'm going to apply those changes the indicator starts to move for favorites i'm going to go ahead and click that button and it seems like something is missing here as well so let's go look at the view model well i have some properties here but it seems like i have no logic to load the data let's make a change that's needed now i could have typed this but just to save us some time i'm going to paste the code in it should have been here and you can see we have a constructor an async method private method all this can be applied to the running app by hitting the apply code changes switching back i can go ahead and switch to the home screen switch back to favorites and now i see the data but i see one last bug it's only loading redmond let's go take a look uh yes would be easy to miss it should be an i instead of zero i'm going to apply those code changes and navigate back and forth there we go and now we get all the data we expect now with this app it usually could take 15 to 20 seconds to restart the application and it's a small demo app but with hot reload we were able to make all these changes without having to restart the app a single time imagine how much time it will save you cool and that's hot reload and net six um i want to do one thing here i sometimes i think you know like the videos don't have enough of the uh uh the flavor of this um i want to show this in person so this is i'm not even short in visual studio i'm going to show it from command line so i've got a blazer.net 5 application here which i can run actually let's do this it should launch the browser i i don't think what native yes huh well i can work around that normally it would actually launch that for me but let's let's just do this we can control click bring it up here's a blazer app and you know i can come over here and put this over here put this over here um and you know we can make changes in this this is a.net 5 application so let's go to the counter page and we can say the dev intersections and i don't think it's going to actually refresh from me because it's not doing the refresh model sometimes when you have too many beta bits i know the 601 will work and i'll just go and show the 6-0 thing here so let's just cancel that out know six will do what i want so the 601 is launching notice it says hot reload enabled launched the browser and uh if i was smart i would have actually here's the code so i've got my blazer app and i've got a a vs code running and let's take a look and see what the perf is to update this application so uh we'll go back to the counter page and let's say in net six give it a second here now what i'm going to do is i'm going to add a couple exclamation marks here and i'm going to press save now take those back away press save now that is instantaneous um let's let's click the counter okay i went to 10. now let's go change the code to go by two i'll press save and now we reset the app the app actually blinks a little bit it's reset um and it kept the state notice it still says 10 and it's still there if i click the button it now goes up by two so basically you can make markup changes you can make code changes even from the command line and we can update these things instantaneously in visual studio it's even better because in visual studio we're actually running code to actually run intellisense we're compiling your code as your type so when you press that apply button we take the code we've already compiled in memory and just inject it directly in the running application and so it's it's is sub 100 milliseconds and to me this is a one of the biggest missing pieces of dot net we as i said before we've had great runtime performance we've not had the best inner loop performance and you're going to see us take this as serious as we take in uh any of the runtime performance as we move forward and so i uh very happy with that and with that let's go back to slides um preview 4 is available today with maui support in visual studio you can build the blazer um uh desktop applications there's some templates with minimal apis uh uh and so i would i would ask people just go go to dot net slash get dot net six and grab that preview um we plan to ship uh i should talk about this too we have this ml.net library that does machine learning it's actually a library used by office and if you ever have if your machine supports windows hello that's where you can log into your machine by your camera that's all running this tech and we've added support for more architectures to date as well we've added arm 64 and m1 this means you can now run ml.net in inside of xamarin projects on ios and android uh we have this cool tech that's in the picture here called model builder they write your a lot of the code for you and helps you train your models and stuff like that and it was before it was kind of every time you went through it you had to restart the whole thing and now it's actually reentrant you can go back and retrain or change some parameters and do those types of things uh to make your your tech work and we have a feature called automl there as well which will pick algorithms and stuff for you automatically so there's a bunch of improvements in ml.net um and then i really have to say is we're going to ship everything i showed you on november uh the 9th and we have our own virtual conference on november 9th as well called.net conf it's our three-day event uh that's both uh it's about half microsoft and half community where we will show and talk about all the new stuff in dot net six uh that will ship that week uh so that's.net conf um and so you know thank you so much for coming out i want to say something is uh you know as richard said when he's when he kicked off um this this is the first in-person event i've been to in uh over 15 months i think i think january of uh 2020 or something was was probably the last one of these and so i i want to thank everybody for hanging in coming out even microsoft there's a couple of us there's scott kate and myself from microsoft we have no travel budget because with kovid the company was like well we don't need anybody to go anywhere because it's there's covid and so it was even hard to get money to come out here and and see folks but i really am happy to be here i'm glad we have an in-person event uh and uh you know thank you for supporting the show um and with that i will also say there is a new in-person show that will be this december um probably on a much bigger scale than this because we will be six months more into uh vaccinations and stuff like that so thank you so much i have a session later today where i'll go deeper dive on a bunch of the.net stuff if you want to come and attend it i think it's at noon but thank you so much for coming hope you enjoyed the content and see you next time
Info
Channel: Microsoft Developer
Views: 19,288
Rating: undefined out of 5
Keywords:
Id: ba33CqjqacA
Channel Id: undefined
Length: 55min 29sec (3329 seconds)
Published: Tue Jun 08 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.