Showing posts with label hunter. Show all posts
Showing posts with label hunter. Show all posts

Monday, 21 October 2024

.NET Core 2.0 Released!

hi I'm Scott hunter and I'm here today to talk about net especially not net core today we just released net core 2.0 and you can grab it today at do tnat slash core go out there and grab it right now and for the next hour so I'm going to go through all the new features all the new cool things in net core that you want to check out so first off before you can get into that we have our virtual conference net comp which comes out September 19th through the 21st this is a great virtual conference that you should block out some time for and you're going to have all the experts at Microsoft on the team you're going to have a lot of the experts in the community talk about net over those couple of days and all the new stuff that's in.net core 2.0 so you can check it out at net comp net and we will see you there next let's jump into dotnet core 2.0 I think that a quarter point O is the kind of the first real release we shipped out to core 1.0 last summer and it was a great version but it had preview tooling and we know we got feedback from customers that all the api's we're not there and so then a core tune kind of rust over all the rough edges and the coolest thing is as part of that McDonough core 1.0 we talked about how AFC net core was one of the fastest web frameworks on the planet we've made dotnet even faster in dotnet core 2.0 so now we're about a web app is about 20% faster depending on how you run it Dan Ross going to talk about that limit later today more AP is one of the biggest feedbacks we got on deck or 1.0 was hey a lot of my favorite API is the old dotnet EP has them used to things like data sets are not there they're all back we have a bunch new project templates so now if you want to build an angular app with asp net core or react with app with a ethnic or those are all in the product more distros one of the cool features of dotnet core is the fact that we are multi-platform it runs on Windows Mac and Linux we've added a whole bunch more Linux distros in.net core to and even better for a developer we have a the ability to target generic Linux and that means you can actually run net core to on most linux's without even installing a specific version for that particular Lenox simplified packaging if you follow this in decor 1.0 we broke the framework into a lot of packages thinking that would be a great way to update all those individual pieces separately but into being that it was too hard for us and it's too hard for you you don't want to have to reference all these individual packages and find out we're going to guess where which api's are in which packages and so now we've made it very simple in asp.net you reference one package for dotnet core you reference one package and you're good to go we have new and improved visual studio tooling we'll do some demos of that a little bit later on but much better tooling and we have great BS for Mac support as well so everything I show in dotnet core to you can run the same stuff in Visual Studio for Mac so let's also talk about this is exciting as well with the release of that net core 2.0 just a couple days after we ship Red Hat will have the Red Hat version of.net core 2.0 as well and they have a great no-cost developer license that you can grab at the URL here to try dotnet core 2.0 on Red Hat so really excited to have Red Hat following us so quickly into the - oh wave let's talk about the the open source aspect of net this is one of the things that really excites me is two years ago when we first started saying we're going to open to arsenic core we had no idea what the reaction is going to be was the community can come and come join us and help grow Nets and the cool thing is they really have if you look at this chart you can see the amount of pull requests by the community over the months we're at a point now where about half of our pull requests are actually from the community and even better you can see that we've had a bunch of cool companies embrace us because of the Samsung is building their Tizen platform for their televisions their mobile devices and their appliances and wrist wrist watches on dotnet core so you can actually use dotnet to program all those things we have earlier games they've moved a game they were building their own web server and net and they recognize one day that we were trying to make net core super high performance and so in trying to build a competing web stack they actually came and helped us make dotnet core way way faster and so when you see the tech and power benchmark where we scored really well last November it gains helped us a whole bunch and you can see here as well we have a foundation a dotnet foundation by big people industry you can see we have Red Hat Samsung jetbrains uni and Google that are all participants in this so it's the open source thing has been great for net now let's talk about dotnet standard this is my favorite part of net core and and.net and and even xamarin and when we started working on that core a couple years ago one of the challenges we had with dotnet was there's lots of nets there's not net framework there's Ameren there's there was not net core there's mono there's lots of dot nets out there in the world and they each had different sets of api's and so we said as the dotnet team let's stop this we want dotnet to be consistent across all platforms and so dislike html5 is a specification for web applications dotnet standard is a specification for dotnet and what that means is if you're a dotnet platform and you want to be you want to be known as a.net platform you have to implement the dotnet standard and that's basically a contract of a bunch of AP eyes and so any net that we consider a real net that influenced at that standard has to have all those AP eyes and that's pretty cool because it means you can easily move your code from xamarin app to agentic or app to a dotnet framework application and later this year with rs3 of Windows you people do the same thing with you to PP applications as well so let's look what that looks like what we basically did with that net standard 2.0 is we added about 20,000 api's back we took the intersection of all the api's that were in xamarin and all the api's that were in dotnet framework and use that as the basis of what this would look like and then we went through and added all those api's back to dotnet core 2.0 and so much bigger surface area the other cool thing about that standard too is when we look 70 percent of all the nougat packages in new georg actually support standard to today which means as a especially as an asp net developer or done in core developer a lot more of those nuga packages will work out of the box in your applications you might ask why don't some of them not work well some of those 30% that don't work with their referencing things like windows forms or WPF or technologies that don't exist on all the dotnet platforms the other cool thing about the dotnet standard is it doesn't require you to recompile any code and so in a demo I'll do in a second I'll take some a library compiled back in 2002 and just add it to my project and it'll just work and that's what's cool about that net standard 2.0 here's an example if you're a done it core 1.0 customer and you've been using it for a while here's a hint of the stuff coming back all of xml came back all serialization came back all the networking stacks came back all of i/o all threading all of core so I'm super excited we don't have it on the slide here but data came back as well so all the data sets data tables I've used those a ton in pass code and they all work great with that in standard two so let's do a quick demo so what I have here is I have an AF core one one app and I went out looking on the web for zip libraries and I found sharp zip Lib and if I look here look at this package it was built in 2011 s been out there for a long time so let's try to reference this in my h-net core 1.1 project so I'll bring up the nougat package manager here you we'll go browse find sharp and I'm going to add this to my project and notice that the package restorer and it rolled back that happened because dotnet core 1.0 did not support the api is required for sharp cichlid to work so let's instead let's move to a dotnet core 2 project here so I've got a dotnet core to project here I'll do the same thing again and first up this to show show this off a little bit I'm going to add the CS proj file and you can see this is using.net core 2.0 zoom in a little bit here this is a dotnet core 2.0 application and because of Sutton at core 2 I can come back to the same example and say manage NuGet packages I can browse and let's sign sharp as if Lib and I'm going to add it and this time because we added TI's back notice that now getting the dialogue saying this is going to succeed the nougat package is added and I should be able to do a build here successfully added restoring to build everything works great so this is showing you that now I can take a dotnet core 2.0 application and because of dotnet standard 2 and the support we have for that suddenly all this existing code out there is available to my apps so that's not in that standard 2.0 the next thing is let's talk about performance improvements so one of the cool things about being open source is a lot of places where we don't have time this we're always focusing on you know new web frameworks or new libraries to bring into dotnet making it cross-platform we don't always have a chance to look at all the bugs out there and dig into all that code one of the cool things is being an open source project we've had tons of submissions from the community the diff fix performance problems in low-level pieces of nets that we've never had time to go look at and those are all in net core 2.0 we have profile guided optimization this is where we actually run applications through the system and measure how net behaves in those situations we do optimizations based on the profiles that we create by running the applications and then obviously we're we're running the same jitters that we are on the full framework on that net core as well one of my favorite examples here is ray gun they have a product called ray gun i/o and they use a node base back in a couple years ago and I ran into them and talk to them about dotnet court at the time and said hey we're doing all this perf work they actually took their same application which was doing a thousand requests per second on nodejs moves it's dotnet core and we're able to get 20,000 requests a second and that's mainly because of they are an i/o heavy application and we can do more background i/o than note can so that's kind of cool the next thing is as part of our launch today we also launched Visual Studio 2017 15.3 you can download it today at Visual Studio calm and we're going to talk a little bit what's new in it first off better together dotnet core plus vs is an awesome tool for building applications we have full support for dotnet core 2.0 and 15.3 and we also have full support for net standard 2.0 thought that standard 2.0 can be used in your win for Maps your WPF apps your estimate apps your attic or apps your console at school everything can use that in standard 2.0 the other thing we did is we made it very simple to have a project files that work both across the CLI and Visual Studio so we have great support from the command line if you're building net core from a command prompt or on a Linux machine or a Mac and these projects go back and forth we're going to show later today that you can also transfer these same projects back and forth between Visual Studio for Mac and Visual Studio for Windows one of the areas that I really love is code navigation improvements so today a lot of our customers actually have to go install third-party extensions to get the best out of Visual Studio and so we've been spending a lot of time over the last year trying to find the most common things that people are trying to use those extensions for and make sure we have support for those just in the box we're doing that because loading a third-party extension uses more memory slows the product down and so we're trying to get you all those same features faster with less memory another exciting part of vigil City of 2017 15-3 is we have CI CD support for containers this means if you're building containers in dotnet core you can basically go through a wizard and have a CI CD pipeline set up using V STS which will either target Azure app service or our asher container registry so right from vs as you make code changes builds will kick off in the cloud the land if they pass all their tests the land either an app service or the land and a container registry all built in another cool feature that we shipped in march with visual co 27:17 RTM was liveing at testing and the idea behind this was today typically you do test kind of an afterthought you write some code for awhile and at some point you run your tests also because it's a kind of an afterthought you don't really see when you're writing your code you have no idea what code is covered by a test what code is not covered by a test and so the idea behind logit testing is as you're developing you can see live in the in the ide which code has tests which code doesn't have tests even more so than that as you actually make source code changes in the product we actually will identify which tests have to be rerun we'll run them on the fly as you're editing and typing and you can see whether they're succeeding or passing and you get so great great visual coverage in the the IDE so that's life in your testing and next I'm going to do is I'm going to have Casey come on and she's going to do a demo of the editor work and lugnut testing so let me there's Casey from the team she works on net productivity on the tooling for.net yeah hi guys I'm here to show you how vigil studio 2017 it's going to make you as productive as possible as you're coding Visual Studio 2017 has a lot of the awesome features that we have for other dotnet projects also for dotnet core for the first time ever we brought like live in your testing over to.net core yeah I think you're going to show the do project system as well yeah and so you'll see all code analysis I'll show a little bit the new project stem and bunch of different things that you can do in dotnet core so here I have a simple net core 2.0 app it's basically just lets me yell at my Alexa in the morning figure out when my bus is coming and the first thing I want to do is show file globbing so files globbing allows me to just drag a file from here from the file explorer into my project and then you'll see it immediately appear over here on my solution explorer so this is automatic syncing between the file and solution Explorer now we're at existing file yep so Don to manually add the file yourself and sort one two merge from source control and things like that can you open the CSV file as well yeah I can also show you the new CS Praja so rather than having to unload a project and reload it to edit your CSS prajapati's now just do it directly from here so I can click on this and you'll see that the new CS proj file for dotnet core projects is really small and if you look closely you'll notice that when I added that direction file it doesn't exist in here I was not there yeah which means which will save it's a ton of time when you have ton merge conflicts in your CSS proj file from all the different files that you and your team have added and removed super cool yeah so they're just some of the productivity enhancements I've done for dotnet core project specifically you'll notice in this direction file that I added that I have a merge conflict in here so it's a result that we added actually a ton of newer factorings and visuals to your time 17 and you can see here I can you know choose to take the head the upstream or both of the changes that I had and so here I was on take the head and again I access this for factoring with control dot and now it's resolved this merge conflict for me hi so probably my favorite saying that we've added is I should feature we've had for a while but now we've remapped it and renamed it is ctrl T or go to all this allows me to quickly navigate to any file type member or symbol declaration from a single location so I know I want to go to this type that I have called plus helper so I can just use camel case matching to just type in the like the humps or whatever you want to call it of the letters and then it will navigate me directly there so as I was talking about we have live unit testing support for dotnet core now so I can go to test live unit testing and I can click start so what is live unit testing typically when we're unit testing we have this kind of like tension where we're trying to route what is the smallest number of tests I can run so that my R unit tests run in a reasonable amount of time but also a big enough sets that I can feel confident I've run enough tests to actually know that my change hasn't broken something else and so we're always trying to figure out what that but that compromise is between smalls number and the biggest summer for confidence and so once you actually find that set then you have to manually go click a button to run all your tests and then you have to go to a different window to actually find the results of your unit test and so live unit testing is actually removing all of that and doing it for you automatically so live unit testing will figure out what code is impacted by your code change and run those tests and then display:inline the results so you can see a red X means that this line of code is hit by at least one failing test a green check means a sign code is hit by all passing tests and a blue dash means this line is not covered by any test at all to me this is the coolest feature is just being that quick visualization what I have tested what I don't have tested what failing we have open up other windows or run other scoffs yeah you never have to lose the context of your development to see the impacts of your changes is awesome I can click on icon and see exactly what tests are hitting that line and you can just double click to actually navigate directly to the test itself so if I don't actually know why this is failing which I don't I can just right-click and choose the debug this test so this is all on dinette core so we have all assumed debugging support live unit testing support for dotnet core projects that we have with all the rest of the dotnet projects so if I should hit a breakpoint here and debugging a new feature that we added in Visual Studio 2017 is to run the click where if you hover next to different lines this little icon that pops up I can zoom in to show you that or I can say run on my program to this point so I can just do that and when I do that my execution failed because I've actually thrown an exception and this is a new exception helper that's part of Visual Studio 2017 where we cleaned it up and we try to put at the top level the most important information so here I'm throwing a reference exception so it would be nice if I knew what was null and this is actually telling me that the lot variable is null now I know exactly what I need to do I just go through all the air text behind that air anymore yeah I don't need to restart my debugging session to figure out and step into different things so again I was talking about we added a ton of new refactoring the Visual Studio 2017 so I who's come directly up to my parameter list and press control dot and now I have the option to add an old check for this parameter I can do the same for my longitude parameter as well and now in a single click I've added all this boilerplate to actually test my or do my node checks for me and without me having to think about it I don't know as I did that live unit testing figure out what tests was impacted by my change ran them for me and updated in the editor in the context of my development let me know that now all my tests are passing that's what's pretty great romaine anything yeah so now that we've shown debugging and summer factorings let's show a couple more so it just so happens so I'm going to use again control P to go to any place that I want so I want to go to the file called stop so I'm going to put an S to filter by files and type in stop it just so happens when you're trying to catch the bus in the morning it depends what direction the bus is going for which stuff you go to learn that the hard way when I first moved to Seattle so what I'm going to do here is now my stops we're going to have directions associated with them so I need to actually add a parameter to my construction constructor subdueth a time type direction and you'll notice now Visual Studio is actually suggesting a variable name for me for this parameter so like hey resurrection you probably I just want to name this parameter Direction and I can immediately do that also while my cursor is here I can press control dot and then I can create and initialize the property direction for me and I can do control dot again and add the nil check automatically as well and so again this is a bunch of quick little things just help you scaffold out your app without you having to really move anywhere and so it makes you a lot more productive I would use every one of those that's awesome yeah so now because actually added this for my serialization have to add adjacent convertor so again you can do the camel chase matching in here so I can type Jason C and they can see all the different things that match type of and again use the camel case matching to help me autocomplete unit testing is actually letting me know that nothing is covered by this and that's because I haven't actually used my updated constructor anywhere so to do that I'm going to go to final references to figure out all the places that I have this constructor lucky me it's only one place in this app and now I can just add my last parameter and here where I'm adding the direction of my stop to my unit test to check that it's working and again live unit testing went through figured out what code was impacted by this change figure out the tests that need to run and then ran them for me and now I can tell that all my tests are passing despite me adding a new parameter to constructor shuffling things around and stuff like that yeah so you might notice in here now are these pink dots over here which they're actually gray by default but pink is a lot better-looking to look at and matches the blue color scheme so I made it that way and this is a code suggestion code suggestions allow you to like hint best practices or alternate coding patterns to developers so if I investigate here you can see that's telling me to use the explicit type instead of var and this is part of the code style configuration enforcement that we've added to Visual Studio 2017 that's one of my favorite features where you can actually on a project basis go and set these rules and say these are the rules of the project everybody has to hear those rules in the write warnings or errors or whatnot and so we actually allow you to like codify all these different conventions you have in an editor config file so I can just navigate to an editor config which is an open source file format that we worked with the community and extended to work with dotnet code style and to see here all my different of our preferences so I've chosen four built-in types so when the type of the parent to use bar otherwise I want you to use the explicit type and you can configure this at the directory level so if you want to at the project or the solution level you can do those kind of things as long as it's in that directory you you'll also notice and here that when I actually converted to the explicit type I've used a c-sharp seven two pole which is my favorite c-sharp seven feature which allows you to return multiple values from a method so here I've returned both a route and a stop and you'll see that there's now pink little dots down here and if I investigate those I can see that this code suggestion is helping me learn the new language features where I saw me hey I've named my tuple element route unstop and so rather than using the item one and item two which is really hard to understand when you're just trying to access these different members we can now just directly use the explicit name instead so again code suggestions are really great for enforcing code style across your team and learning your language features but the other things are good for is helping learn best practices so we've actually in version 15 3 we have a beta version of the FX cop code analyzers where we've written all the FX cop rules which are just a ton of rules on best practices with performance and security we've written them as live analyzers in the code to get live feedback inside the editor on different code violations people use those before that used to be an external tool that you ran statically against your code and that was like being as an analyzer it's live in the product you don't have to actually do an extra step it just runs all the time and so here's an example of one that's here on my bus helpers if I do control dot to see what it's asking me to do I can see that saying hey you have all static members inside this class you should probably just make this class static so no one can instantiate it and again in a single click it will now make this fix for me we went through all the FX copper rules and took the ones we thought were most pertinent today and with the ones ones we're moving into analyzers yes so we took like the most commonly used ones that people were saying that they used and we made them into this extension that you can install today's I have installed here on the last thing I want to show is we have all these grades added lines going on editor here which are indent guides this allows me to hover over and just kind of get a better idea of like I'm that kind of like code and so I can see here that I have another class besides bus helpers in here and how the class called my stop info which is basically what my file is named so I'm just going to use the refactoring that we have to move this bus helpers type to a file with the same name because that's how my team likes to do it where you have a different file for every type and so in two seconds or less I was able to now make it into a new file and so those are just an again will let me notice the whole time live unit testing has been running and still let me know in the context of my development without me having to navigate to a different window or run a test or click a button that all my tests are still passing and so those are just my favorite things that we've added in Visual Studio 2017 to help make your dotnet development awesome those are awesome thank you very much good yeah thank you okay so now we're going to move on and do as you're functions in Visual Studio so there's been is huge push in the last year so this interest around building serverless computing and what this is is instead of building a full web application just building the small snippet of code that you actually want to run when something happens in the cloud whether a REST API gets called or you have a trigger that's fired from a vent or a file is added to a storage account something like that that's that this new model of programming called serverless computing and we want to make sure that c-sharp dotnet and visual C are the best ways to build those types of applications so with Visual Studio 2017 15.3 we've added support for Azure functions directly in the box and visual studio and this tooling is pretty cool you can basically build c-sharp functions and what's what makes the tooling so awesome is you can actually develop them locally first we have a emulator so you can run them locally in Visual Studio put breakpoints in them all that kind of stuff then when you're ready you can push them up to the cloud and you don't lose any of that functionality you can actually still put the breakpoints and run the breakpoints in the cloud just like you do locally so it's a great experience and we've changed the way that functions actually work they are now class libraries in Visual Studio which means you get all the supports of c-sharp all the tooling all the cool features that Kasey showed they all work with Azure functions now and so next I'm going to bring Andrew Hall up and he's gonna do a quick demo of Azure functions cool so this is Andrew Hall Andrew works on visual studio tooling all up for.net and today let's let's talk about added functions yeah so as Scott mentioned already we've put it in the box for visual studio 15.3 update all you need to have is the Azure development workload selected you'll notice here that I don't have any of the optional components not because I don't want them just to prove that we don't need them so it's included by default in the azure development it's really tiny only adds a couple megabytes to the installation just check check out your development and you're good to go just check as your development you're good to go you'll get everything I'm about to show you so when you come into the cloud node in Visual Studio this is the new project experience you'll see the Azure functions project template shows up so you can pick that how do you have one that I've created and by default you'll see that it drops a empty project and I have two files so one is host Jason that I can configure settings this is all documented online but we're going to go ahead and build a queue trigger so when we push things into a queue we're going to pick those message up and process them and I've set the max polling interval I've upped it just for the purposes of our demo because I want it to process relatives and explain to people what this means is I've got a at your table table storage set up in the cloud and I've got a queue inside of that and you're saying anytime somebody puts an event into that queue it's going to call your code that's correct okay and so one of the great things about Visual Studio is we have a schema you can see we know the schema for host at JSON that we've created and I can configure settings so for example I mentioned what this max point interval is going to do is it's going to say this is a millisecond value check the queue every thousand milliseconds or once a second but if I hit control space because this is visual studios JSON editor so control space you can see I get intellisense for all the possible things that I can configure about my application so just by virtue of working in Visual Studio I don't necessarily have to remember the exact commands I just control space or start typing I get the intellisense that I would expect in visual studios first-class JSON editor let's go ahead and back back out of that the second thing I have is a local setting set JSON file and what this is is this is a file that lets me specify things like connection strings or whatever it's not it's by default going to be go dude from source control because it's supposed to be your local settings so the default get ignore that gets dropped with this will prevent that learn and source control but in this particular case I've populated a required property as your web job stored just as the required storage account for working with as your functions required for every function type except an HTTP trigger so now that we have this configured we have our storage account connection string plugged in we have our polling interval set up to make sure that we're it's going to pick up quickly let's right-click on this and let's say add let's add a new item and we're going to pick the Azure function template so let's call this which we call this let's call this our cue trigger and bring up dialog so let's go ahead and pair it so you have a whole bunch of types there so I'm seeing blobs event hubs generic webhook HP triggers Wow lots of lots of services in Azure yeah so these are these are all pre-baked in templates in visual studio these match the types of triggers that you can create in the portal as you mentioned on the portal by default you're working with a c-sharp script file so tsx as you already told people in the introduction one of the things that we've done in business videos we've made these class libraries to give you a first-class development experience it also gives you better startup performance and Azure because we've already done the work on the dessert on the on the client side to compile that into a dll right so you're not going from source every time so that's the face locator what does what does that do base locator I believe this is a cognitive service that actually find spaces in your images that's cool yes there's a lot of fun stuff to play with you can really waste a lot of time or I guess is not waste you can spend a lot of valuable time playing with creating your own as your as your function triggers with this hopefully a lot of people watching have already had the chance to try this because we had an extension that we shipped at build that was available to install on top of Visual Studio 15.3 so the big thing is we cleaned up cleaned it up a little bit fixed some bugs and as I mentioned we've now made it part of the azure workload as opposed to happy to be something you have to go install separately so let's call this our cue trigger and we have a connection string here so this will use our as ur/web job storage here as your web jobs storage and the path is my cue item this is going to be the name of the queue so if I go over here I have storage explorer open and I can see that I'm going to use this Andre how Channel 9 I can look at my cues and I can see that I have my cues items so the name of that's all going to line up and we're about to see one of the big benefits of going to pre compiled functions that we've done with the work that we've done in Visual Studio 15 got three after I create this for people to watch this if you see as your storage Explorer that's a great tool if you're actually using Azure storage you can search for that download that and it gives you a visual representation and in fact I actually use it to copy my connection strings so I when I do this exact same demo like it I connect that thing first in a copy of my connection string format your storage Explorer into vs yeah and that's exactly what I did that's a really good point I did went cooking show style a little bit I have that might you know pie in the oven what the connection strings already pasted in but exactly that's where I would have gotten the connection strings from one of the big differences I want to point out here now that we've generated our cue triggers es file for the pre compile function is you've moved away from a world where you're mapping between your Azure function and what you're going to trigger off of me information is decoupled so if you look at in the portal for example for Azure functions you have it at the SX file and then you have a separate function that JSON file where you specify all the information of what is the connection string and what is the cue that you're going to map to what we've done in Visual Studio 15.3 is we've brought in the azure web jobs attributes along with this new attribute called function names so the function name attribute indicates that it's the this is going to be an azure function so that's how the runtime will find it the private attribute all the configurations being moved attributes on the actual code correct so my CS file in this particular case is an entirely self-contained thing so I can see it I can edit it I can do it all in the same place that no more decoupling of those things so what's right so let's go ahead and run it so one of the things as you mentioned is we have a fully local loop so let's just go ahead and hit f5 to start debugging this application and so once it spins up we'll see that we'll have the console up this is the local as your functions runtime that you mentioned I think you called it your emulator in the introduction and so now let's open storage Explorer and let's go ahead to my q and let's push a new message into the Q and I'm going to expect that that break point is going to be hit so let's say hey Scott we push that into the Q and within a second I've hit in Visual Studio and that's why I upped that polling interval just to make sure that happen quickly and if I look at the my Q item that's been pulled from the Q I can see my string that says hey Scott so this is the message we just pushed into the Q ourselves cool so let's say that we were happy with the way that this is working locally it's a pretty powerful function right we can say hello to ourselves and log it to the console I had the ability from Visual Studio directly to right-click say publish and I can publish it directly to Azure and I can try that out in the cloud so we're going to go ahead and create a new as your function app so I'll click my publish button there and you can see that it's going to query my subscription it's going to populate some information from the cloud it's going to show me my options resource group I created a channel 9 resource group that we're going to use for this I want to create a new app service plan in this case going to show one of the powers of functions is this consumption plan and consumption plan is only available for service computing but what this means instead of these machines where have dedicated resources and I have a cost associated with paying for dedicated resources a consumption plan is only going to charge me by the millisecond that my application right this is really the benefit of serverless computing is I only pay for what I use correct and so we're going to go ahead and pick this same storage account we're working off before which is my channel 9 storage account and so now when I click create it's going to create all the resources that I want up on the cloud and then it's going to copy this application of the cloud that should be running up and Azure we should have the ability to go hit it so you can see that we're on step 2 of 3 so this will take a couple seconds ok I make an assets in the cloud this is a copy of stuff up at the cloud and then once you're done we can run and do all that kind of stuff perfect so now I have a summary I can see the time that I've been successful so let's go to my Azure portal I'm going to open up my list of function apps in this particular case I only have one which is the one that we just created I can see my function app when I click the this it's going to populate so I can go into my queue trigger function and so this is showing me the gist the JSON that's generated that mapping file that I mentioned that we used attributes for on the locally but it generates it and so if I look at my logs if I open up my storage Explorer and I push another message into my to which says this is the cloud and I click OK when I come back to the portal I can see that the message I just added this is the cloud so from visual studio I took my function app I compiled as a DLL I was able to right click publish it directly to Azure and it's now running an azure and it's going to fire and execute anytime that the events that I've chosen the trigger off of you're only paying for when it when it's called and we're not going to show it but if I wanted to I could also open the clot Explorer in Visual Studio found that same function and attach the debugger to it right some videos to you that's correct yeah you can just right click on it you can say remote debug so if for some reason it's working locally but you get it up into the cloud it's not working correctly you have the ability to debug it absolutely cool awesome as your functions okay let's move on from functions the next thing I want to talk about is we just today also shift Visual Studio for Mac version 7.1 you can also download this today at Visual Studio calm what's cool about this is digital scene for Mac has full support for dotnet core 2.0 you can build console apps API apps web apps all with digital to you for mac and it's got full support for dotnet standard 2.0 as well so all the stuff that I was showing a Visual Studio for Windows you can do in Visual Studio for Mac next I'm going to have James come out and we're going to show videos to you for Mac okay so I'm happy to introduce James from the mobile developer tools team working on xamarin and visual cue for Mac and all things mobile yeah you name it I do mobile I love it you know me I love this stuff and honestly I'm super excited to talk about all the brand-new Visual Studio for Mac features we have for.net core 2.0 I'm crazy excited about yeah me too I've got this I want to show a hard example so you know we could've done file new and and built that and copied it from my machine of yours but I found this complicated app it's got all the stuff you might have in a real app if I scroll up here I've got data models I've got tests I've got a back-end front end let's run this thing it's a real app I can click see users need is going on so how about we copy this app from my machine to a memory stick and see if you can run it on the Mac that sounds good often I'm working with teams with multiple machines often on PC or Mac and this is the stuff that you have to do you have to be able to work on multiple machine so you got a dip great zip file on your stick for you okay and I'll give this to you all right and while we're waiting for him to set up one of the cool things that I like about visual Cu for Mac is both of our teams are working really close together to take the features of Visual Studio and move them to the Mac so my team especially we worked on living the HTML the CSS the Jason editor directly from Visual Studio to the Mac so when he's showing those in vs for Mac it's the same code that we have in Visual Studio yeah so all I did is I copied it the zip file to my desktop I went ahead and simply DoubleTap the solution and see here it should launch Visual Studio for Mac there we go and Visual Studio for Mac will give you a whole bunch of different file new project things and I'll walk through those in a second but already as soon as I open it up we can actually say that it's restoring all of my packages because you're kind enough to delete all of the need to get packages so it's a nice small zip which is nice and hold we can see is we have the same exact folder structure file structure intact so every single project in solution in the solution actually loads from my tests to my models to my actual web application here so you'll see all the dependencies all the files everything like that there we go it's gone ahead and packages are restored I'll hit go at this point is going to build up my donek web donna core 2 application and then deploy hopefully just like we saw just over there so let's give it it's building building building because it's a big rush it's a big app and I like it you didn't just do file new because that'd be way too easy right there we go launch into the browser there we go localhost 5,000 loads up visitors blows up my records and there we go the same exact app so you and I could be working in source control together and one one of us on a Mac one of us in a PC and just being productive exactly yeah I love it and then I can have all my normal debugging everything that you would expect all powered on Visual Studio for Mac now let me actually walk through some of the other things that we've done here because it's more than just ability to open the stuff so let me go ahead and actually walk you through Visual Studio for Mac a little bit so anyone new will have a little bit of experience when I go into a new project and I'll zoom in a little bit here we have kind of multi-platform applications that I'll walk through we have iOS applications Android Mac TV OS and right here is the dotnet core applications from libraries asp.net core and of course libraries right here I can come in create a dotnet standard library awesome right here if I go in and I say oh I want to what do I want to target down at standard - oh that is a single library that I can then share between all of not only my asp.net core donít core my Dameron applications and uwp applications - so kind of everything now we talked about getting started it couldn't be easier let's say I just wanted to create a blank council application I can come in pick between F sharp or C sharp I'm a C sharp guy so I'm going to say C sharp and again kind of a very similar flow of what flavor of dynacord I want and of course I want donek core - so say awesome da net core - now what this will do is it'll go off and just like we saw earlier it's going to go will see all of our dependencies here or SDK and we can see that we have our tool of to go to oh SDK now at this point I can just simply go ahead and hit a breakpoint set a breakpoint on hello world command line comes up and in just a few seconds debugging a dotnet core application right there here we go stop debugging from the council but it's more than just file blank new application right I can come in and I can do everything that you we're talking about with asp.net core in fact even the razor pages as well we wanted to bring over that similar experience so here if I come in and say awesome razor pages there what we'll see is that Visual Studio for Mac will of course not only scaffold out and bring in all my dependencies and nougat and SDKs but we're going to come in and we can look at our pages that are here so if I want to go into my about page I have my CF HTML I have my c-sharp code behind files and you can of course come in and modify any of the files you get full intellisense right inside of there if you want to come into your web root you of course can modify your JavaScript your CSS files so if I wanted to come in and adjust the padding we have the full intellisense coming in right it's the same CSS editor from visual studio for Windows so brought right over so now again just like we saw your application I can come in I can start actually building my application deploying my very first Rick I love Razer bridge is so cool from Visual Studio for Mac again it loads up it deploys as you'd expect and boom it's running I think this is awesome I can build my mobile apps in either vs for Windows or vs for Mac I can hold my web apps in vs windows ES or Mac yeah great experience yeah and you nail that you nailed on the head actually I want to talk about one final thing well I have the stage is that often I'm building back ends with donek corneas get on a core with web api's for my mobile applications and we made a drop-dead simple for developers to create a full multi application so under multi platform here I can select a salmon forms a mole based application or native iOS and Android app when I select that with one button click you can add an asp.net core Web API now I've done that here so I brought in all the packages and it scaffold out a full master detail application brings in master detail shared code for your mobile apps add on a standard library and an asp.net core application everything with Web API and a full website everything like that and what I love here is that you can see that I actually have i OS and a web as my startup projects was cool is that we actually have multi process debugging built-in so I can come in and set my iOS and my web application as the startup so I can actually debug my iOS app a my web has a service running and the mobile operating at the same time exactly so when I hit debug what we're going to see is that the iOS simulator is going to pop up it's going to launch my application at the same time over here launch my actual web site and here it's actually going to start hitting breakpoints so will actually let it spin up fully as we have some items there we go so we have an item here we have a website here and I can actually go to flash API flash item and we see we have one item C sharp is very sharp over here C sharp is very sharp now this is cool and I hit add let's hit an add new item here and I'm actually break pointing inside of the iOS project right when I have that item I'll sterilize it send it out to my back-end now what's really cool is it hits a breakpoint in my asp.net core application and it brings me to the code file right here another thing super cool continue on we can see that the actual item is now added not only in the iOS app but in the web app is right there then when I'm all done guess what you can do you can right click publish and publish to Azure cuz I need to put that actual asp.net core application right up into Azure I've logged in with my asher account so to quarry all of my services I can go ahead and select one or I can go ahead and create a brand new app service plan and everything all from Visual Studio for mac which is super awesome same experience and individual tee for Windows same experience in visual to you from Mac yeah that is a great experience we think developers are going to love it so go to visual studio comm and download the S or Mac today so let's move on next thing is a s phonetic or 2.0 lots of good stuff in a student core - first off faster in certain circumstances like running the Tekken power benchmarks it's about 20% faster than a s connect core 1.0 so very happy about that we have a new framework called razor pages and it's meant for people to want to build web apps sometimes the Model View pattern MVC requires you to have a bunch of files in different folders and stuff like that if you just want to go get some stuff to the web quickly we just want to write an API sometimes a simpler programming model might be more interesting and so that's what razor pages it I'm going to have Dan come up in a second and show that we've also added support for c-sharp 7.12 razor so when you use razor in asp net core 2 you get all the latest c-sharp features one of my favorite features is azure diagnostics and live analysis and i'll do a demo that in a second as well and this is you as you start publishing your apps to the cloud things change I no longer have access to the local machine how do I diagnose and debug these applications we've built a lot of capabilities in to.net core 2 that enable this to happen automatically and Azure and I'll show that in a little bit another one is we know a lot of developers are building applications with angular and react and so we put templates for both of those programming models directly in the box it gives you a front-end application with a s connect or back-end as well so it's all wired together so it's a great starting place and then we always want our temples to give people best practices and so most of us probably use to factor off to access some of our popular websites and we typically do that with an Authenticator app on a mobile device and we built that same feature into a s connect core so if you want to build applications for your company and have them support two-factor authentication we've got great support for all of those those applications so next I'm going to have Dan Roth come up so I wanted to introduce Dan Roth from the eighth net team he's here today with me to talk about a s net core 2.0 oh yeah so let's just jump in I've got a quick demo before you go and I've got the same instant core application I was showing before that I added the old library from so it's you know it's with that in standard but what I want to show is I'm going to publish this out to the cloud and show this new diagnostic feature so week so let's go over here and right click on our app we'll publish click publish so this is going to help me diagnose my problems when my app is live yes so some of the feedback we got with a snake for 1.1 was we put a pin sites directly into the project templates and so some people complain there's a pin sites NuGet packages there's some stuff inside of my web app I'm trying to help I know we're trying to help and so what we've done in the incident core 2.0 all those same features exist but if I look there is no app insights in my new capacity my will just go and list let's show that real quick oops here comes the browser join my live app if I go look at my dependencies and I look at nougats there is no app insights there so we took it out so we'll know where that's what's gone so my apps running up in the cloud now what I'm going to do is I'm going to go to portal and here is my app and I'm going to click on it and once it loads up in the portal something new is going to happen here notice this banner that you look at the top here click here to access app insights from monitoring profiling your Assn core application so instead of having to install app insights in my project inside a visual studio I can have inject it right from the portal so I'm going to click that button so this is without any like adding any packages or code to the actual appliqué a package is no code nothing just go right to the portal and say because typically maybe my developer is already published and I need to sit these insights I just go and let's enable it and this is going to create a app insights for my application and it's going to wire up all the new diagnostics so give it a second to finish that and notice once that happened the new banner shows up again no data automatically instrument your asp net application restart required so if I click this button this is going to relaunch my application and when the application relaunches it's going to actually load those assets like nougat packages that we did not install in the actual app on my developer machine okay so like it'll light it up just like it is liked it up bolt it on after the fact so let's watch here interpreting my application take a few seconds okay so I'm going to close the app insights panel real quick and show a couple other cool features about this my app is now running in the cloud and if I go down to diagnostics logs I'm gonna do something that you never could do before so before if you wanted to see logging inside of app service you had to actually go add a nougat package and hook some stuff up so I'm just going to go say hey I want some logging and I want my logging to be at the information level and I'm gonna click Save so I didn't republish my app my apps is still running that's been successful so let's go to log stream and what's gonna happen now is the portal is going to connect to the logging in in my ethnic core application and here it is live so let's go back to the web app and let's click around a little bit so is this like the asp.net core logging infrastructure like all the stuff that goes through I lager and lager factory it's just wired up just wired up no plea as I as I click around the application all of my logging goes in and what's cool is if you notice before I can set the information level so if I have information so a lot comes through I change it to warning and click Save then less information will come through because I've changed the warning level so I don't have to go and republish my application or do any configuration right from the portal I can live control the amount of information that I see the next thing if I go back there I can come down to the same section and I can click app insights app insights actually takes a little bit of time to actually open up so well hope things are hooked up here like provisioning from some app insights resource well for performance reasons it takes a while for your after I clicked around my app a little bit it takes a while for this to actually kick over in app insights because it doesn't want to slow your application down so it's actually slowly seeing that data around so we might not see it here for a second but let's go back let's click around a little bit more in the app go back to the portal let's do a refresh so look at there so now you're starting to see data flow through I didn't actually do anything as I said it takes it takes a minute or so for it doesn't start flowing through but the cool thing here is now developers can publish their apps to Azure without having any app inside configuration turned on right from the portal they can set their the log level they want see the live streaming logs in the portal they can also go to the app insights tab and see all the app insights data just flowed through automatically just by publishing doc just like okay logging and diagnostics so at this point let's flip over to you and I think you're going to show us what raised your pages yeah I'm going to show you a you know creating an application with asp.net core 2.0 so HP dotnet core 2.0 is all about making things easier like making it easier to get started making it easier to develop your app making it easier to build great UI let me show you what I mean so here in in Visual Studio I've already created an asp.net core 2o application this is just an empty web app and I just want to build some UI but let me let me show you some of this little difference your pages folder there yeah yeah that's that's where we're going to add our pages but I want to show you a few things first that are that are simpler now in this model like if I show you the the CS proj file for this product for this application you'll notice it's got just one package that's it and you don't need any other packages this package literally brings in all of asp.net core into this application so you no longer have to go hunting over the web to find which package do you need to get that feature that you want to use it also has just one version so you don't have to figure out like which version of which package you need to use with that other package over there you pick the version of the product you pick the version of the package and you're done and you're that's all you got to do and and literally everything's there if you want to reference individual packages they're all still there like if I expand the the node in the solution Explorer you can see them all now you might worry like isn't this going to make like package restore like crazy slow no because all the packages are already there as part of installing dotnet core yeah they're catch all these things with your machine so you don't have to worry about that and when you publish you don't need to bring all that stuff with you either because in dotnet core 200 we have this new feature called a runtime store so all those binaries are actually already there as part of dominant core - oh so and they're warmed up in cross-gen they're ready to go so you don't need to publish them with your apps your publish size is actually significantly smaller than it was in one Yanase to the core 1.1 or 1.0 application we were actually publishing 15 Meg's of MVC every single time you public was really good MVC bits but yeah if you did have to bring with you now you don't have to do that at all you can just just leave them behind they're already going to be there ready to go if we look at like program CS like that's also a lot simpler in this app there was a lot of stuff here that you had to do before like setup the server like wire up kestrel setup is integration set up your content route none of that you have to do anymore because we just do it for you by default and we do a lot more actually like we'll set up your ear config for you will actually put config in di by default and we'll wire up the like Jason config providers for app settings Jason we'll set up the user secrets file stuff so that you can keep your secrets out of the source code logging is actually enabled by default because the config specified one of my favorite one of my biggest complaints about AF snake or 100 or 1 1 was developers told me all you get to create an object but your configuration inject that into the I and I'm like just put the configuration in there for me so I'm going to access it from any of my controllers we did that for it's already there you can just use it from wherever you want to and as a result my startup code now it's much cleaner like I don't have to set up that that config object anymore I'm not setting up logging because it's already set up for me we've already set up the console logger that the bug logger so it just feeds right into Azure for example and it just works but if I want to set this stuff up manually I still can right again that's where all those api's are still there we're just trying to help you get started faster to actually build your app which is what I want to do I want to build some UI like I'd like to just add some pages to this app how do I do that so I'm going to use what you were talking about which is razor pages razor pages is a new app model in asp.net core - oh it's built on NBC that allows you to just add pages to your app that render dynamic HTML so let me show you I've got that pages directory that you mentioned I'm going to add a new item right here show you how quick and easy it is to get started now writing dynamic you I'm gonna add a razor page index CS HTML that means it's just going to be the home page of my app and we should get some razor and there it is alright cool so I got a razor file with nothing in it yet because I found like a student webpages although that it's it a different much more fleshed out model like it's literally built on MVC so all the features that you know and love from MVC they actually still continue to work like you might notice I actually do have a view imports file in this directory that sets up you know the namespace for all my pages that's from M you see it just works you start that just works tag helpers that just works because it's built on top of MVC I get all the power in VC and I get the ability to do CS HTML files in a folder just like I could with web pages so I get the best of both world you get the best of both worlds exactly so I have a code behind file this is my page model this is the mod I'm going to be going to use to decide what to render on the page so let's add some stuff like it's just let's do something simple so I'm gonna add a property let's add a string let's call this I don't know like current time great so that property is on my model and it's referenced from my page so it's not it's now going to be accessible from this piece of razor now we want to populate that property with some data so in my on get page handler so this is where you can handle the request as it comes in whether it's a get request or a post request I'm going to set the current time to be I don't like date time now and we'll make that a string so that we can easily render it on the page alright okay so now if I save that on my page let's now go actually you know render that current time we'll just add a header and we'll say at model to refer to the model current time perfect let's run it let's see what we get hopefully we'll see what time it is on our server in big beautiful text and all right great there it is and if I keep hitting refresh you know the seconds tick by as the app refreshes that's how easy it is to get started with razor pages you just add a page and you got and you're ready to I love this I don't have to have a controller folder or views folder I don't have to have routes I don't understand how writing works between all that stuff yep you can still do those things of course you have controllers and and views you can absolutely use all that but this is we think this is a much simpler way to do UI now this was a very simple app let's do something a little bit more real I'm going to file new project up now and we have of course templates for razor pages I'm going to select to create a new a spinet core Alek and mix the two systems together I can have some views and controllers as razor pages on the same applicator you can do them both and they work beautifully side by side you can have some Web API is that our letter embassy controllers and have some UI with Razer pages that just works while you're on the screen we should point out these new templates ago I was about to do that time to do this so here I'm going to create a new razor pages based app first of all you'll notice that I now have two web application templates so the web application Model View controller that's the one that has use and controllers the same template that we've always had still works can continue to use it web application template now that's using razor pages because we think it's just a simple way to get going with building UI and adding pages by the way you'll notice that we also have the templates that you mentioned earlier for angular 4 reacts for react plus Redux that's just an easy way to get started with building a spa with asp.net core as a back-end we're going to work with razor pages so let's add that this is going to give me a template that has the standard you know three pages that we have on almost all of our templates the home page the about page the contact page now what I want to do here is add a form razor pages is great for doing forms based programming so I'm going to open up the pages folder and the routes to the pages are just determined by where they are in disk so if I want to go to the contact page I just go to slash contacts so there's there's index that's the home page there's contact and there's about you notice that we also have you imports do you start those or it's just built on NBC so those things just work we even have a layout the layout just works it's like MVC so let's go to this contact page and we want to add a data form here that lets you submit your contact info so that you can we can contact you about our great products you know something like that super easy so what we're going to do is we're going to go to the code-behind file and I'm just going to add a little class here let's call it a contact and then let's just add a couple properties on this let's add a name and let's add a email address so that we can actually contact you now I want to I want some validation on this guy so I'm going to make this this property required using data annotations the annotations just work with razor pages it's all MVC required for the email address as well you've got to give me both okay so now I want to render a form on my page using this this contact model so I'm going to add a property to my page model of type contact okay and that's going to allow me now in my contacts HTML this model type will have that property and I can use that to render the form I'll spare you the the typing on that I've got actually already pre typed here and we'll just copy this and put it into the page so I don't have to do that manually but the super acts are pretty easy to do but there we go so there's our form now this form you'll notice that it doesn't actually have an action attribute that's because the form tag helper will automatically set the action attribute to just post to the page by default that's the obvious thing to do then we have two fields one for the contact name and one for the email address and that's it and a button to submit we run this we should be able to see that form now now there's nothing that this is going to post to yet we need to add that in a second but let's just make sure we've got our UI so let's check this should brought us to the home page we go to contact great we've got our little form so now let's go back to our model we need to have some logic here now for handling the post requests so we're going to add another page Handler instead of on yet we'll have an on post I got that here as well just to save some typing so let's go ahead and copy this onto the page model there we go resolve a namespace so we can get our action result action results because then we see you again so what's this going to do so when we post the form data it's going to check the malla state to see if it's valid or not if it's not it'll just render the page and say like here's the errors the things that were wrong then you would normally like save the data someplace like in a database we're not going to do that here but you would just have a DB context you you inject it into the page model like you would have controller it goes in the constructor works just like like that-like is NBC you could also inject in the page itself with that inject all the directives work and then if things are all good then we're just will you know what's a post redirect get so we'll redirect back to the page just to show that yes everything was good now I would like to do something here so what I'm going to do is I'm just going to set it like a success message like yes thank you for your contact information we got it you're good to go so I don't like thanks I'll just reference that saying property contact uh name wherever you are we'll contact you soon via and then the email address of that person okay great now we should probably render that on the page as well I think I've already got like a header that renders that message but let's change that to like a like a P tag and just set up some bootstrap so that shows up and green so like text to a success because this is a success message and I think there's also one more thing I got to change which is on this um get I don't want to clear the message I want to actually leave it as it was now this is almost done that message property will get populated when the post comes in but first of all like how do I actually get the contact data like I should buying someplace like I could I could actually put it in the post arguments that's there's like you good with an MVC action but instead of doing that because I'm already got this property right here I'm just going to bind it right here to this property that's super convenient and you can do that on your MVC controllers too like if you want to use that same feature there you can also that message property I need that to survive the redirect we have a feature in MVC that makes it easy called temp data what you can now do is you can attribute a property and say please back this we buy a temp data and so that means when I set that property it'll populate into temp data when I read from that property you'll read it out of temp data and that should be it okay so let's go back to our like view our page and let's uh let's click Submit and I didn't put any data and so I expect to get like some some validation errors that say like you didn't provide a name we didn't provide an email address and there they are okay now if I put my name in and my email address there it is and then thanks Dan we'll contact you soon that's raise it very cool very simple if you publish it it'll be smaller also when you publish it and run it it will start up faster than it would in 1:1 because the the runtime store is already crossed also we will pre compile these pages and your views so that you don't have to do any runtime compilation that just happens in demo that's a new feature that we have into o as well is we are pre compiling CSS HTML files as part of public as part of public by default you just want to do anything it'll just happen and then at runtime like you said it'll be faster because the throughput of 200 is faster than 1:1 as well awesome thank you so let's move on next we have entity framework core 2.0 any framework core is a new version of any of you framework that we built as we built net core the primary goal of Adichie framework or was to have obviously a version of energy framework that ran cross-platform just like that in core does but one of the things I like to think about with any framework core is it's a version of.net core kind of internally we used to call it any of you framework everywhere because the idea is it can run anywhere today so it used to be the engine framework could only run on the.net framework that runs on net core it's not that standard compliant as well which means it technically can run on uwp as well so whether or xamarin so whether you're building a dotnet framework app a dotnet core application xamarin application or even a uwp application and the rs3 time frame you have the same data data data framework that can go all those places another cool thing about a new framework is we have a couple goals here and one of them is to obviously make it very easy to build awesome applications with address equal and sequel server and so we've actually enabled features in sequel server like in-memory tables you can actually do with attributes with energy framework they've already shipped that and we've also done all the stuff for accessing databases in the cloud where you might actually need to have like retry policies and stuff that's all built into any framework or and I've got a couple of features in on the screen here that we're that are needed framework or to my favorite one is probably the performance improvements if you're used to programming at a do net level you're probably familiar with connection caching where we actually have a pool of connections and keep using those we've got a great new feature where you can actually have a pool of context and so if you're having an app that's running a lot and doing a lot of requests you can cache these contexts and reuse them so it's kind of like connection pooling for energy framework contexts I'm going to have a Diego Vega come up and present some of these features so if people can go to the dotnet blog to read the announcement and see an overview of the new features this one is about the the fact that we look at performance profiles of some 80 or netcode applications that we are using EF core 2.0 sorry previous version and we realized that we were spending a lot of time creating instances of the ideal context yeah pretty much anytime we create a controller yeah which every time a request comes in we create a controller we're going to create a context cuz most people make the context a member of their controller yes that's it and and we we try to address this in two different ways in 2:01 is first make it cheaper to create you know like we have a view context that is using dependency injection internally to create its own dependencies and those are scoped they get created every for every request and then they go away and we will use the number of a object need we created for each one but we also took a more radical approach based on on the same idea that we have been using for connection token 11 for all the years and that is well basically we can have like a pre created set of the context instances that are ready to use every time there is a new request that comes in we pass that to the controller and when the controller finishes the work we can take it by the pool then we use it for the next request that has the token and all we need to make sure is that we are cleaning up all the state that means we cannot that we are disposing all those that need to dispose and things of that so we want to show a demo that is actually one of the simplest demos that I have seen we have a a this is actually a console application that is simulating everything that a an external application would do with a real context it has this small D context with just one entity and then it has this section where we are configuring services this is a line here that has the call to the context is important that's the registration of the D context type that are going to use in the application and then to simulate what would happen in a normal application I have created this method request async that is basically doing the work that was happening in a controller action yeah and this one is doing a lookup in the database so we're going to run this the way it is and we are going to see some numbers so this is executing a bunch of requests is creating a bunch of threads to simulate what is happening a real application in this in this particular case for creating contexts a lot of times every time when it is request from the ESRI recruiting in context so we're throwing a bunch of memory out there a bunch of times it's just like a snake or went and optimized a lot of memory usage away now you're going to show a new version of this it actually yeah doesn't do doesn't work as hard exactly so the two numbers that I want people to remember here that are important is the total number of contexts that were created to do this works a lot that were like more than 70,000 and also the number of requests per second is the throughput that we achieved with this way of doing things yep now I said that this is a very easy mo because all I need to do to enable the new feature is to change this call to add three contexts to a new API that is called happy context pool and this one the way it work is basically running up the same capabilities in dependency injection but instead of giving you a new instance of the D context every time is going to give you one from the pool so a one line code change we run the application and what we see so we are seeing that very quickly we achieve it better to put but before I can see the very throughput and add at the end here we're going to see that look at that only 32 content created versus 70,000 yeah that's dramatically dramatic difference because there's going to be much less of our patients to serve the same number of all right when I take my existing es core code I change one line of code and my web application and suddenly I'm using a lot less memory and my applications faster awesome let the iris collection as well so one one detail a people you said you asked about this is that why is that we are not adding this to the default template even even that is so good and that performance is so much better with this way and the reason we we don't do that is because we want people to be aware that the feature changes how things are going to work right and for instance when you create this blow in context this is your own user class it's derived from the mini context and you can put your own state in there and if you are not careful using this feature if you have your own context you're right young okay if you put your own set in there well then you're going to be in trouble because somebody else is going to see that same state over and over again and it's not really your state you're sharing that today with everybody so yes you pull something you need to be aware don't don't we putting your own private user data inside of that DB context because it's not your own private data yeah exactly so the feature knows how to reset all the state of the duty context that we know about on every time we we put it back in the pool but you don't know about what the user put subject on a class yes that's something that we can improve in the future but currently we don't have a way to do that yeah we should probably do an analyzer in the future that actually tells you not to do that or we can give you a method yeah for that okay what else you got so the other feature I wanted to show is a very simple feature and this one is also very easy and I think that this is say I want to yeah I like this feature too yeah I want to give the language team a some some trades here actually all the credit because they build these these features is reading revelation string interpolation we added the Sierra if you if you look at this code what is doing is basically using an EF model and is using a feature that we call from which you can use to execute your own sequel in a composable way so you can invoke some sequel with with some sequel and then you can continue adding link operators on top of it but I want to be careful arrived and I don't have any like sequel injection here because I'm passing a parameter in here so this is pretty against sequel injection I would assume so this is this protecting you from sequel injection but in the way that we did it in the first version of EF code so if I show you how how this works basically sucking for a 10 a turn I'm going to type cut here this is showing me the secret that gets generated I'm putting the select I can see the variable there yeah there was a parameters and created for it and it's being passed to this this is actually a table body function in sequel server based in both yes and this is safe but it's not as nice so one one thing I may want to do is I'm using the new features in c-sharp the exemption of seeing a 0 here which is undoing yeah bye bye order so C sharp allows you to do I can actuate the variable directly and yeah a dollar sign there and then just say okay I want to put term here sorry I'm in turn and this is a more concise way of writing this query I know myself and I've done sequel in the past I've had I passed so many things in I was 0 1 2 3 4 5 and by the time and all the parameters scrolled off his right side of the screen and so I wasn't sure what they are and so the interpolation feature being able to put the name of the variable directly in a place I want is amazing yep and now you support that with any different work or yes the things that if you did this with the first version of anti-fungal cord it would expose you to I mean it will fail but if you if you add some quoting here probably turn this to the string then it would be exposing you to C code in general injection so what we wanted to do is say ok we want people to be able to use this nice way of writing the equation and incorporating the parameters in line in the query but we want it to work the right way so we wanted to create parameters for them and we want to we want it to be site perfect I love it so I get all the features of string interpolation in c-sharp I get all the protection from sequel injection all with the F core 2.0 yep also if we execute this now is the same say we ask for fish and it's also generating the parameter on the and using it in the call to the table of the function here so the way this works people are excused when we see when they see this demo is really because the language team invented this in a very small way they created a new type that is called formattable string that can hold all the information for an interpolator string including like the text and also the parameters so we created an overload of from sequel that takes a formatted string so we can actually capture the whole intent in one variable and then we create a sequel for you cool awesome okay thank you for the demos no problem thank you thank you okay so let's move on I want to close with something I think is really important earlier this year we launched a new part of the.net website do tnat and it's our architecture guides we got a lot of feedback from customers saying that hey we're looking at moving to the container micro service world or I want to look at how I would move my application from on-premise to the cloud and so we are now building some patterns and practice style guides and what's cool about these guides is they're in an eBook format if you want you can download a PDF of these books and read them offline you can also read them online on Doc's not Microsoft comm but even better after you click one of these to download it'll take you to a page afterwards showing you all the resources for the guide that you selected and the best resources each of these content contains a sample as well so if you select microservices and containers you get a great book to learn how to build and and ripe micro services that run in containers with net in the cloud but also you get a great sample application that shows you the best practices and a lot of things you're going to find in the sample applications or things like you can see health checks those types of things or patterns we're going to actually move out of the samples and put into the actual dotnet core in the future so if you're looking at how to build modern acid net and dotted core please come to this page and learn more key takeaways I think the biggest things as a.net developer that people should take away from this is that in a standard - I think it's the most important thing here because it means all of our all of my dinettes xamarin dotnet framework dotnet core all have the same set of common api's across all the great code sharing you can continue to see we have performance you know we had great performance results with dotnet core 1.0 we're continuing to push that envelope again as Dan was saying earlier 20 percent improvement in the tech and power benchmark for a snit core and then the other part of this is nothing makes gotten that better than awesome tools and we have Visual Studio Visual Studio for Mac and Visual Studio code which are all great platforms for building applications with nets and don''t core to is supported across all of them so go out download dotnet core to today at DLT got any tea slash core and give us feedback on how it works

.NET Conf 2019 Keynote

hi I'm Scott hunter and I'm here today with my team to announce dotnet core 3 to start off let's talk about what da net is dotnet is this platform we've built for building any kind of application you have whether it's a desktop application a web application cloud mobile gaming IOT AI dotnet is a general-purpose framework for building all of these types of applications I'm super excited to talk about dotnet core and how far it's progressed it's only been out for a few years and we've already grown to over a million active net core developers that it core is our first fully open source dotnet framework and in the short time we've actually been open source we've already taken a hundred thousand PRS so we're building this not just by ourselves but with the community and of course Visual Studio 2019 is the faster the fastest adopted version of Visual Studio ever here's a couple of our customers that we build on top of dotnet we have an awesome page on the dotnet website you can go to to see all of these customers and read the stories behind them so I highly recommend you go and check that out after the conference let's talk about down in core 3 you can actually download this right now you can go to the dotnet website and get it right now the bits are available and it brings a bunch of awesome enhancements to dotnet core first off we brought desktop support for WPF and windows forms any.net core application gets the ability to be fully side-by-side and self-contained meaning dotnet doesn't have to be on the machine we just introduced we're going to introduce a brand new way of building web applications where every web application is a spy' occasion and then of course we're always making you more productive with Visual Studio C sharp and we're gonna talk about a lot of these things today with my team to start off as well Visual Studio 2019 16.3 just shipped as well along with Visual Studio 2019 for Mac 8.3 both of these versions of Visual Studio support dotnet core 3 C sharp 8 they have a ton of productivity improvements performance improvements and if you're a mobile developer they support iOS 13 and Android 10 so they support all the latest stuff bunch of our partners have released brand-new tools today for dotnet core 3 if you're a web developer and you're gonna use blaze or our new spa application there is controls by DevExpress telluric and more that are available today so please try these things out as well so the first thing I want to talk about is micro services micro services is a is a new developer phenomenon it's taken over in the last couple of years when I first arted doing development we build these what we call monolithic app monolithic applications where you build your database and your front-end and your back-end all together in a combined application that was great when we were had small teams building applications but as these applications have gotten bigger and crossed into more spaces it's more important to break them out into smaller pieces so those individual teams can actually work on those pieces so not only can you build micro services but you can also host micro services really really well in kubernetes what kubernetes does for you is it's an Orchestrator and that Orchestrator will basically take your application and manage all the components whether it's configuration whether it's scaling whether it's making sure the application is still running well and we have an awesome one of these called agile kubernetes that runs in our Azure cloud now with dotnet core 3 it's the first version of.net core that really really really enables you to build micro services so what we've done is we've added a bunch of new features one is we have something called G RPC what G RPC is it's a it's a form of communication that gives you strongly typed contracts between the application but what makes it unique is it actually works across all developer technologies we're gonna show it in the context of dotnet and c-sharp today but what's cool is you can actually build a micro service using G RPC and you can call it from Java you can call it from node you can call it from Python any of the languages you want will support this the next thing is worker services while we build great web frameworks the last couple of years as you start thinking about micro services you want these long running applications that handle responses requests in responses and so we now have a first-class template inside of Visual Studio and dotnet core 3 they'll let you build these worker services what's cool about this is you get all the same features you get to configuration that pin Injection all the logging all those things that dotnet core brings or available there as well we're gonna show that a little bit later on and then finally as you abilities api is you want to make sure they're super secure and so what we've done is we've actually worked with one of our partners to make sure that you can actually securely secure your endpoints using identity server and so with that what I'm gonna do next is we're gonna have Glenn Condren come on stage and we're gonna build a dotnet core three micro service and host it up in Azure oh hey Glenn hi how's it going it's going great why don't you switch your machine and let's show us your service yeah so a bit of context for what we're gonna do here is I am gonna build this weather micro services service and then all of my friends after this they're all going to come in and they're gonna consume this thing from an IAS cluster so I am going to encapsulate the logic of going and grabbing the weather data I'm gonna cache it locally make sure we honor expires headers do it's not it's not complicated but it's not trivial so we'll make our own service for it instead of having everybody talk to the weather API themselves so what I have here is I have a just a normal file new G RPC service I have a console app and I have a standard class library we're gonna use later but they're all standard except that in my weather app I have already set up some config for the URI and I've put in some user secrets and stuff so that you know you all don't try and steal all of my tokens so first thing we need is a worker so I am going to add this class we're going to call it weather worker all right and this thing's responsibility is going to be to go and grab the weather data and get it in the cache locally Ram and like this so I have some snippets for pretty much all of my all of my code and so this inherits from background service which we had a little while ago this is how you can add a service that will run forever you know I've got do some logging some config I need config to get my URI and then in kubernetes it actually uses the kubernetes config provider to grab all the secrets from kubernetes secrets which is kind of cool I have a hard-coded location ID because you know you don't need any other weather than that what's in Redmon's and then the mead this execute async method and all its gonna do is loop for as long as the app is going make a HTTP client gonna go and call the weather API get some get some JSON response use the new system text Jason that we added to deserialize that to a type and then cache it and then it's gonna do that every 10 minutes forever for as long as the apps running and so I'm missing this forecast data this is how does the weather endpoint I'm hitting represent the weather and so I'm going to add another class to represent that call a weather model not see us you know if I can not put some some extra caps in so what I did to generate this I have a snippet here for this now what I did to generate this and what you can do is I just grabbed an example Jason payload from the API and I just copied and pasted as c-sharp into visual studio and just made this whole thing for me and I'm just going to ignore it that's a cool feature video convictive take your jason and can convert it to see chart types yeah absolutely it's a super cool feature then okay so now i have a worker this is done i'm good now but except i need to tell the app that it's going to go run that worker service so now over here i'm going to start doing some code I'm gonna add add hosted service which is the name of this feature add weather worker right and then this needed a few things it needed like HTTP and like caching right so services dot add HTTP client so I can inject the HTTP client and then I'm gonna add the memory cache memory cache so that it has a memory cache right this now when I boot this app it's gonna go into every 10 minutes ago and get some more weather data pretty simple pretty cool now I need an endpoint so Scott talked earlier about G RPC and some strongly typed this so so this J PC is a very contract driven approach to our PC so I have a snippet here which gives me this proto file which is the contracts for a G RPC service and so I have this proto file that says I'm gonna make a weather service it's gonna have a get weather streaming endpoint which it should stream weather constantly and it has a get where though that just returns you a single whatever the current weather is and it also defines what the actual response-type is nice thing about making our own like proxy for this where the data is we get to choose the actual surface for our clients and make it relevant and not have too much extraneous data right so if we just call this weather dot proto and then in here the way this actually works is in my CS proj I have this protobuf element which references that way the proto you see the rename worked good job team and it says it's going to generate server because the way that G RPC works is you create a contract and then you generate a lot of code and you just deep lament the bits that matter and you leave all the rest to be generated right I write that contract and I generate either a client or a server using the tools yeah exactly and so then we're gonna go create a weather service now from my from my snippet and so what we have here is a service that implements this weather base and that's that generated code that we just talked about where so we just controlled on my way to glory here I have the base class I have a memory cache because I need to get the data out of the memory cache and then G RPC doesn't want you to have empty method calls but because I'm hard coding the weather for Redmond in this case I've just got this empty type - to fill in for the request type you would probably in most cases have an actual type here that has your data right yeah past your location or something yes I think yeah and then I just have this get current weather response all it does is left hand right hand code to say take that just pasted code the pasted model earlier converted to the one that we want to actually give to all of our all of our friends later and then get where the returns one and then forget where the stream it just loops for as long as the person is connected it just grabs the data out of whatever is in the cache currently and then loops right and then this is to every ten seconds just so that it's easy so you can see something for the sake of the demo we might actually even make this two seconds just so you can see some data constantly changing we know the data will only actually change every ten minutes or so but you want to Keane just can to kind of keep a constant stream happening right and then that's it that's greatest service so if we will rename this to Weather Service so that you know just because we can't have a class with a different file name it'll be terrible and then you know startup CS the way you register these services is we have a map G RPC service endpoint right so now I can change this to Weather Service and that's it at this point my app can run and it'll go do its job and so now you want a client to go grab some of this weather data to test it out so I added this console app earlier conveniently but I also added this weather client Lib so I could go over here to my client console and then add a ref to the proto file and have you generate the client code straight into my console app or any other like dotnet stuff that we're gonna show today but what I can also do is I can come over here I have a completely empty net standard class library except for either default class which I'm going to delete all right and then I can right-click on this and say add service reference and then click add new G RPC service reference browse to the proto file that I had earlier that are the same profile that my weather app is using to generate the server code and then I can say generate client though here in this drop-down right instead of there's some other options for what you can generate I'm generating a client in this case I'm just going okay this is gonna go install the new Yeti goodness that you need to make a Geo PC generate code and generate all the types that you need so this is pretty cool so you built a service if we build our first micro service we install G RPC into that mm-hm and now you want to write a client so all you had to do is basically reference that same proto file from your service in your client and will generate all the code for you absolutely and you just then it generates you kind of the basic yeah it generates you all the codes for the clients class yeah absolutely now all I can do is new it up and start making calls yeah so let's look at what that looks like so I'm just gonna add a normal project reference now to my client class library because everybody can now share this net standard class library that has the client code generated in it all they can choose to reference it directly and then in my program CS I have a have another snippet here where the client alright and I think it's actually the whole the whole class I did this time and then what I'm so yeah you can see here like as you just said this weather client was all generated for me I just I just knew it up I used this channel type to give it the address and then I have a strongly typed method forget whether async which was my contract file you start calling them and start getting results back and write them out to the console absolutely so now I can make ctrl f5 this weather service it'll spin up on my local machine you'll see we'll see the console output in a sec it's gonna see the output go fetch the data and then sit there and be a gr PC endpoint and then so here you can see it going and getting the data and then being ready and then over here I can then like go debug start new instance of my of my client console and my client console a ping up it's gonna grab a single weather and then just say done in this case cuz that's I'm just grabbing is calling a single weather endpoint asynchronously I'm using async like console app that we added a little while ago and then it's like apparently 53 seems reasonable that's pretty awesome so in just a few minutes we built a brand new project using the worker service a long-running process like you would build a micro service yep that goes out and fetches weather from an in point somewhere and then we actually added G RPC to that service so a client can call in to that and get that weather data back yep absolutely well let's switch back to the slides for a second and we'll talk about c-sharp so along with that Nikora 3 we're also shipping the next version of c-sharp c-sharp 8 it has a bunch of new stuff and we kind of broke it down into buckets one that one of the things we think about is we always want to make your code safer to write want to make it easier for you to catch the errors early or prevent the errors from ever occurring and so there's some new features of called nullable and c-sharp 8 to try to address some of that stuff modern as well as we as we look at language we always are looking at other languages and we're looking at the patterns that developers are using today and so one of the cool features we have in c-sharp 8 is async streams and we're gonna show those in a little bit and then productive we always want to make you more productive so the goal of c-sharp is to add the right features and stuff to make it easier for your write code and write code faster with less less text in the screen at the same time also tooling all that with Visual Studio family so you can actually be more productive so what I'm gonna do next I'm gonna bring Mads on and we're gonna take the demo that Glenn had and you know Glenn didn't really write it the best way you could we're gonna we're gonna make it use async streams well I think Glenn did a fantastic job it's just that when he switched back to the last let's switch back to the laptop and look at the the proto that Len put up there there were actually two end points here there was a get whether that he used that he called just before from the client and there's a get whether stream which continues to stream whether down so that's the one we're going to investigate now and find my way back to the program here so there's if you look at the if you look at the client here it also has a get weather stream method so that's probably the one we're going for and that can't be awaited instead we get something that we're gonna explore a little bit so let's just call it response for now and let's start drilling into it so if we say responds dot we see that it has a response stream that sounds stream e let's do that and that one has to read all async that sounds streaming and async that one's pretty good right let's do that one so if I call that then what do I get back that's we can actually drill into that as well let's try to it just f12 our way through there's read all async it returns something called ia singen or mobile of T and Ising enumerable if people remember I know mobile is a core type and I know mobile of T is a core type and net that you can for each and and produce new ones from the language as well with with your return with iterators and so I I think normal is just a it's just an async version of that and we can actually take a very quick look down the rabbit hole here I think a normal ball just like enumerable has a gate enumerator this has to get async enumerator and if we drill into that you can see that it has a current property for the value that we're currently looking at and it has a move next method but this one is async right so if you think about it this is a stream where you can pull elements but every time you pull a new one you do it asynchronously so it might take time and you might you have to wait it okay so that's how that works under the hood now at the language level we would like to support for reaching over these so let's try to for each over there the thing that we got back from our drilling here so let's call that for casts with an s because we hope there are multiple and then we can let's try to for each over its reach VAR forecast in forecast and now what we get is oh this thing can't actually be for each you and that's because in c-sharp we decided you shouldn't just be able to for each over acing things because then you can't look at your code and see and know the racing and know that you're doing something anything right we want every a weight to be visible in the source code so you can know that you're sort of getting off the thread you're doing an icing thing you're it's a point where context might switch and so on so what we have instead is an a weight for each syntax that then you use when you have an eye and eye async enumerable and that you just put the right Curly's in there for for the beauty contest and and we're good so now we've actually called this training in points and now we set it a async loop around that end point yes it the code honestly to me Mads you just took a for each and an edit await in front of it yeah works I tried to make a big deal of it but it's actually pretty amazing I mean yeah it's it's a complicated feature but it looks so simple when you actually use it right and some you know they're more there's more to it you can actually you'll return in an async method as well now returning I think you know mobile so we have you know async you'll return that's pretty useful right amazing and also there's cancellation built in that I kind of skipped over here but that's a little more to it well it's the idea it's it should be simple later today you're gonna have more talks on c-sharp babe we're gonna drill into more and more features than just the async stream that's exactly right yeah so so just after the little after the keynote there'll be two Thaksin perfect thank you let's go back to the slides and we're gonna talk about desktop so today we have still millions of developers building desktop applications you might ask why well because desktop applications are simple to write web applications are hard they require knowing HTML CSS JavaScript and a bunch of stuff desktop applications in dotnet you can just drag some controls to a form write some code they're very quick and simple we've made them much much better in dotnet core three so in.net core three we've brought wind forms in WPF to dotnet core but you get all the benefits of dotnet core so one of those benefits is side by side deployments you no longer have to worry about an update of the framework breaking your application you can even take the app our our the the the framework and compile it directly into a single XE for your application so you just hand that that application to any machine it doesn't even have to have dotnet core on it that's a cool feature in.net core 3 we've made all of the windows 10 api's available to these applications as well so you can call all the things if you want to get bluetooth or something like that you can do that from a win for more WPF application and then finally because it's done at core we do all of it open source and so we've open sourced WinForms and WPF now what I'm gonna do next is talk about App Center this is a new announcement today I'm I'm I started off as a web developer and App Center for desktop applications really excites me because for the first time ever if you're a web developer you can just add some kind of analytics to your website and your to know how many people called it where they're from how long they were on the site wouldn't you want that same information for your desktop applications if you're building a desktop application you likely want to know how many times it's been used or all the features being used and so by adding App Center to your application you get all those benefits absent can also be used to deploy the application including beta versions of the applications to a smaller set of people so super excited to announce that what I'm gonna do next is I'm gonna bring Ali on stage and we're gonna go build a dotnet core 3 desktop application and then we're gonna actually hook it up with App Center so we can get to limit tree on it as well right so let's switch the machine here and a theme we're gonna have today is as we start building applications you know we built that micro service now what you're gonna see us do is basically build more applications on top of that thing showing you can build on it everywhere and share your code right so I happen to have a weather application myself and that's application it's a ving firms app that sits on your desktop and shows you what is the weather right now let me show it to you it's very simple and but it has one problem I haven't actually finished development of that app I put together UI I put some dummy data that shows the weather on Alderaan planet right now that planet doesn't exist anymore so I all cold yes but I would like to actually show the real data for say Seattle and I just heard that Glen has amazing service running in kubernetes and he also has a client library that I can just use in my fin from supplication to that right and not only that we can actually use it from any dotnet application right mobile web WPF so let's take a look at the library that Glenn created for us if I right click on properties I can see that this library is targeting dotnet standard 2.1 which is great because that's the latest version of.net standard understand or two point one ships with dotnet core three so it's the it's the latest version under standard that supports dotnet core 3 but it also only runs on done in court three so that probably means yes executive your application a dotnet core three desktop A+ no it's framework because I developed it a while ago where I did not have a choice between core and framework so if we go to properties we can see that my app is targeting dotnet framework four point eight I cannot reference the library right now but what I can do I can port my framework application to dotnet court and then I will be able to use Glenn's library and to do that we created a tool called try convert that will take your dotnet framework project file and it will try to convert it to new SDK style dotnet core project file it's a simple command-line tool I'm gonna type try converting Z and as a parameter I'm going to send the path to my project file and understand for Donnie core the project files are different than they are for done in France and so what we built as we built a global tool that can be installed on a machine it's a sample to help people convert their cs proj from an old-style cs proj to a dotnet course now seus yes exactly and now when i click on properties in my visual studio i can see that now my application is targeting dotnet core 3.1 right so is it in just a few seconds i ported my framework application to.net court so now I can reference the library and to do so I'm gonna right click on dependencies add reference find whether clients sleep click ok and once I did that let's go ahead and update my code that is pulling dummy data at this moment so I have this method pool weather that just gets demo data and I'm not gonna need this code anymore I will also not need they get Diamond data and here I was using the local weather response class but I'm gonna be using the one from the client library so I'm gonna delete that code as well now I will insert a few lines of code I will add users and I will talk to those lines so first thing that I do here I'm creating a client from the library then based on that client I am creating JIRA PC weather forecast service and for this forecast service I'm calling get streaming weather so every time the service on kubernetes is sending out the weather data every two seconds I'm getting the data on my app and let's see how that works so this code looks almost exactly like the same code that cool yes yes exactly second ago what they were calling my name await the same stuff yep so we're showing sharing dotnet code across all my application types and that looks like a real data Seattle 53 degrees and weather doesn't change that often but you can see that I am actually receiving new data every two seconds so once I built the application now I probably want to share it with my friends maybe even community right I'd love to have it have this look at that new feature we talked about single XE that's that's a great idea let's publish it as a single eggsy file and to do that I'm going to go to project file and let me move everything down so it doesn't distract us and I'm gonna insert three lines of code the first line published single file will make package my application and dotnet core in the single is all done it cool all your application is at one single Lexi yeah so nothing has to be on the machine that you give them exactly yes it's completely dependent on from the environment it's going to be running on the cool the second one runtime identifier specifies which platform I exist should target and by default that not quark can run on any platform but if we're publishing it as a single MZ file we need to specify runtime and into fire and the third one is published tree that is a new feature that will trim out all assemblers from your.net core that are not used by your application so that way you don't get the entire dotnet core you get on the assemblies that you need for your app which makes the size much smaller all right once I added that to my project file I'm gonna right click and go publish and publish one more time and while it's publishing we can see that here you can specify the password that symbol exe will be put you can also specify configuration target framework target runtime all those settings can be set from this page as well and it takes a while because right now dreamer feature is working so it's actually analyzing what we can throw away if she goes and looks at your app figures out what the dependencies are is best and it's not perfect we call it experimental disk yes so yeah you might find it actually trims too much stuff out and you have to go back to your CS proj and manually reference to whatever it turned out to hard that is true it will build better tech around this in the future and we'll build better cooling but it is a first step that we wanted to ship and donate core 3 yes and as you said if it trims something out it's very easy to edit back to your project row ok so we published our single egg Z and here it is just one exists that I can send to my friends that they can put out for the community and they will be just able to run it and use the app on any computer that has you doesn't even require down in core yes yes so the last thing that I would like to show today is an integration with App Center because as you mentioned web developers have been spoiled for a few years where they could see analytics for their websites they could see how many users they got which devices that what it was accessed from and so on and we would like to enable our desktop developers with the same features so for that you can use App Center let me go to my epicenter portal it's App Center dot Emma's I created an account and here you can create a new application you can configure it but I already did it for my app it's weather Vin forms up once you do it you will get very detailed instructions on how to add integration with App Center in your program and it's super simple you just add a few new grid packages and then you add a few lines in your project program dot C s file so I will do exactly that I'm gonna first go and add new get packages that are required which are Microsoft App Center analytics and the second one is Microsoft epicenter crashes right once I edit it I'm gonna go to program dot CS file and I will add some museums and this is how I enable epicenter in my lines of code yeah it's basically just one line epicenter that start and I send the key that I get from the console and I specify what I want from my app Center it's analytics and crashes now you can detail crash analytics and you're gonna get monitoring as well letting you know that people actually tried the project exactly and I'm gonna run it but it will take the portal a few seconds so if we go here and we go to analytics you can see some analytics so you can see that I was testing that demoed September 20 and September 23rd just today and you can see a few spikes we will have another demo later today with Danielle and Matt that will go deeper and dive into all details of all the great features that App Center can offer and was that awesome so so to recap what you can do now is you can basically build desktop applications with dotnet core 3 WinForms in WPF you can make them into single legs ease it can easily be distributed you can add rich analytics with Azure wrap Center awesome I'm so so excited about this so let's move back to slides next I want to talk about mobile app design right so xamarin is awesome technology that lets you take all the goodness of nets and make it available to all the mobile devices so the idea here is you can build any iOS and Android app with c-sharp and why would you want to do this where you want to do this because dot Nets got all this rich libraries that you can share across all these applications so for example that micro service that we showed before we probably can share that across Android and iOS that's one of the tenants of dotnet and C sharp and xamarin is being able to actually share the same logic across all your app types Android or iOS another cool part of it is we have a library for building apps called Zen forms basically you build it once and it runs on all the devices and of course also all the xamarin tech is open-source like the rest of dotnet today we have two awesome announcements the first one is sam'l hot reload imagine you're in your application and you're gonna change some of the sam'l files well you don't really want to recompile and republish and wait for all that kind of stuff to happen what you want to do is you want to basically save your sam'l file and have your device refresh immediately even better than that sam'l are xamarin hot restarts which is the ability to also change the source code normally when you change the source code that's a full recompile copy back to the device I wanna be able to change that code and refresh very fast as well and so this one's in private preview today you can go to the URL and sign up and you might get access the hot reload is actually available to download today and so next what I'm gonna do is I'm gonna bring up James and he's gonna show us how to get some xamarin apps Oh awesome Thank You Scout so much I'm here in my way cuz you know I need to get to my Mac get to your man okay awesome well like Scott said I love don''t development with xamarin inside a visual studio what I love is that like Scott said you can share all of your c-sharp and Dada and knowledge across all of your applications and that's what we've done I decided that I wanted to take that weather app import it to iOS and Android and at the same time leverage that same exact 2g RPC logic that olya use and that we're gonna use throughout the rest of the day now two important things to remember like Scott said we have all sorts of different texts of pieces of technology for cross-platform development but with xamarin you have access to a hundred percent of the api's in ios and android and always up-to-date we just shipped iOS 13 and Android 10 support so on top of that we have xamarin forms for cross-platform UI and xamarin essentials for cross-platform native API access so let's go ahead and port that exact same weather application to iOS and Android taking advantage of mobile features so here I am on my Mac which looks the Mac yes there's my Mac boom and of course I need to get started with a great design I'm not a designer Scott sorry but Guzman bar Quinn was nice enough to have this amazing weather application on up labs which is one of my favorite websites to use for mobile and reached out to him super happy that were able to use it and I'm super happy that he's an amazing designer so that's what we're gonna do and I'm over inside a visual studio for Mac we just launched a brand new version with all sorts of new tech so I want to show that off too but where you get started is file new project you have cross-platform apps you have iOS Android dotnet core apps as your functions Mac TV OS and watch OS everything is possible with xamarin and dotnet so what I've done over here is I've added an android and an iOS project and I also have this mobile core it's a dotnet standard library just like we can use to share across all things of dotnet but it has xamarin forms in there and this is my mobile specific code so this is things like my user interface with xamarin forms my models my view models my app state but notice that I have that wider client Lib that olia use that Glen had created so it's inside a visual studio for Mac and I can reuse it right here inside the weather app so that mobile core that's the differentiator for xamarin right that mobile core is the code that is shared across the iOS and Android apps right at once and it gets to be used in all the all the devices you can think of it most of my apps have two different Donna Center libraries one that can be shared with anything so restful service calls models things that are just hey this is Don net code then I have my platform specific code or mobile specific code and this UI runs on iOS and Android right so so for instance here if we take a look at how I built this app is I have a weather page and a weather view model so here up top I have a view model I have a weather client and this G RPC weather forecast service the same exact code that olya was showing earlier and since I'm going to be using sam'l and data binding I have some backing fields so for instance I have a used Celsius a temperature condition time stamp these are things that my user interface is going to display and I can tell it to update via set property but here if we look at this message weather service get streaming weather same code the only difference here is that I'm telling it how to render the user interface so here's a bunch of items I want to display in a list and then I want to update the UI I use Samer and essentials to say begin invoking this logic on the UI thread because that G RPC could be coming in from anywhere right so let me just go ahead and run this really quick so I'm just gonna hit debug this is gonna take my application logic compile up my Android application and then deploy it to an android emulator right here running on my Mac so there we go my application is starting up and what we should see hopefully is a beautiful weather application that I built inside of sam'l alright it's doing some stuff but let's go ahead and fill this in a little bit more so I have my user interface code down here and let's see here I have a pancake view which is a beautiful third-party control that will allow me to do the gradients in the background think I'm missing some stuff okay so I have a label with nothing in it so let's just put in Seattle now I'm going to use that zamel hot real Oh so I'm gonna hit command save it's gonna save that and push the changes over into my device so Seattle right there now what we can also note down here is I'm missing some other things in my UI so for instance here we can go ahead and maybe put in a new column and then I'm gonna say binding and the brand new sam'l intellisense will kick in and I can say temperature there we go now it does look like for some reason my internet has stopped so that's good and I'm getting no updates so things are working exactly as planned because we're doing it all alive just super great but I have zero degrees so it did show up so that's really good alright very cool it's very cold in here yeah so other things that we can do inside of here for instance is like this this Monday here so that's just showing a blank so if I look here on the date what we can see is that I have current weather conditions I have this date property here and maybe I want to change this to a Capitol casing so I can say use a case converter say true hit a save and now that Monday is completely updated 100% now what I'll do because I did change internet right before we're gonna go ahead and stop and redeploy again and bring up a new emulator and see if we can get our internet back on our machine which would be very helpful if so you can see actually how fast the emulator rebooted here so let's go ahead and see if this is gonna spice up for me because having real data would be useful always fun to show the real Mike reserves but you can see how rapidly iterating I was on that user interface using zamel ha reload inside my application so there we go we have lather Oh a cool so one last thing I want to do down here actually two things is I like this collection view which is like all the different humidity UV down here and that's a brand new feature inside of xamarin form so here I can say horizontal or vertical but I'm using a pancake view so I'm gonna add a fancy corner radius here and hit save again again Zam aha reload kicks right in boom I got beautiful rounded so fast so fast but you know I like teardrops which are new hotness I think everyone's gonna pick up boom look at that and I can prove that this is running in real time because down here if I wanted to I could go ahead and say time stamp large and now we can see the time stamp from that gr PC client updating in real time or right there which is super awesome and that's Sam aha reload right there inside a visual studio for Mac with all that gr PC client beautiful user interface boom right there now what I need to do though is also deploy this to iOS so normally I would just say you know set that as my start up project go into my iOS simulator boom did it go but I want to show off some brand new features of hop restart so I'm gonna actually head to my Windows machine right now and do iOS development so let's swap places over here I love this there we go Android on the Mac and iOS on the Windows machine that's correct so I'm right over here now what I want to talk about though is that it is the same projects same solutions that I just had open in Visual Studio for Mac so no matter where you're working you're good to go I know your Mac guy I'm a Windows guy so ideal setup right here so that's gonna make it really easy to go back and forth and again I have my shared code and also that iOS proj and that shared code and everything else that I have in here now what we wanted to do with hot restart is that every once in a while you're changing c-sharp code for a saml hot rila user interface code you need to be able to rapidly iterate on your app but what happens when you want to get it on your device and that's some of the cool tech built into hot restart so what you're able to do and what I have here is my iPhone right here my iPhone 7 that's plugged in to my Windows machine ok and what I have up top is my iPhone right there it's connected it's good to go and what's nice here is that all I have to do is hit debug if you've ever done this before you got to worry about configurations and connections and profiles and certain sand all this stuff but what you're able to do with this technology is restart your application directly on to your device so here for instance I have my device that should be screen mirroring let's go ahead and see if it's gonna cooperate with me let's go ahead and maybe shut it down and reopen it let's do this really quick here there we go and perfect so there's my device I'll put it right over here so there's my device right there on the screen now what's great about this is that I can come into my UI let's go ahead and just make this sticky on top cool that looks good and what I can do is add some new technology into here so for instance maybe I want to convert this into Celsius so again I'll just uncomment some code I have a checkbox I have a label this is data bound to that use Celsius I'm gonna hit save now sam'l ha reload will kick in and notice that it's reloaded I hit a breakpoint I'm debugging my app right here on my device so I can go ahead and continue on good to go all right that's good I must have made some changes to my code that weren't compatible but no worries I can just literally use hot-hot restart here to redeploy again so let's go ahead and deploy there we go and you just saw like I stopped took that took some changes good to go I see you'd back on the phone already and that's back on the phone yeah so this is initializing that debug session and Zam aha Rilla so here's our app here's everything is good and now we have this little back and forth but as you can see Scott or have some issues because I hot reloaded that UI but the temperature is not changing now the background is so my converters my code is running so let's fix this if I go into my view model here we have that temperature property now it's returning temp so that's not good so what I'll do is I'm gonna say use Celsius I full intellisense everything here we're gonna use xamarin essentials what's cool about this is it has a bunch of unit converters built-in so you can do like Hertz 2 degrees Kelvin 2 Celsius here I'm going to say Fahrenheit to Celsius and I'll pass it the temp else just temp there we go make that temp there we go now what we can see is that the UI is telling me that hey I've made c-sharp code changes to my application you need to restart your app and what we can do right here is hit the restart button and this will take all of my code changes that I made redeploy it to my device without having to compile it at all and what's great is that this is literally right to my device in just mere seconds those squiggles go away the application is now back into a debug session that I would expect earlier and what we should hopefully see here once hot reload initialize I can hit Celsius now we're in Celsius and I can use my app my real data use sam'l hot reload for my UI and ha restart when I'm making code changes and play directly to my device and seconds with nothing in between that is amazing I have never seen mobile development on either platform of the on the Mac or Windows deploy 2 devices and restart as fast as I seen with the hot reload and the hot restart yeah this is a game changer we want to focus on developer productivity make sure that our developers building mobile apps with dotnet have the most enjoyable time without anything in between no big set up and boom between those two technology would be hyper productive and share all of your dotnet logic like you've seen before across all the devices all your apps thanks James let's go back to the slides and what we're talking about next is building web applications with blazer so the way I like to think of this is if you're building web applications we've had awesome web frameworks in dotnet for many many years but the web is transition to this new new place where all apps are spa and so what if we could just take the technology we already have the day and say you build any brand new asp.net core blazer application that's an it looks like razor blades your razor and those applications just become spas by default that's what blazer is all about it's full stack web development you build an application in net it's a spy out using the same frameworks and the same technologies you're used to already you don't have to relearn a bunch of new stuff the cool thing about this tech is it also runs in all the browsers so it's compatible with all the browsers that are out there whether it's mobile or desktop and even cooler there's one one final piece which is we have a prototype or in preview thing called web assembly and web assembly lets you take your web application and run it directly on the device that means you don't have to actually that it can be completely disconnected it can be running on a desktop it can be running on a mobile device and running as I like a real desktop application we do that because we can compile your c-sharp directly into web assembly that can run natively in all the browsers so what I'm gonna do next is I'm gonna have Dan Roth come on stage and he's gonna show us how to build a blazer wrap hi Scott core 3 yeah great shall we build a single page web app for our weather application using only net and c-sharp no no JavaScript no JavaScript required alright cool so I'm gonna get close on some of this stuff so I can see my there we go okay so to get started with blazer all you need is not in a course Rio because support for Blazer server apps is now in the box so I'm gonna stop the change this app and I'm gonna open up a new visual studio instance and we'll just go ahead and create our first blazar app so we can just get a feel for how it's done so I'm gonna create a new project and let's create a blazer app there it is right there in the box please drop one sounds like a great name and then for this app I'm gonna pick the Blazer server version we'll talk more about the webassembly version and just a second alright and then we'll go ahead and get this running all right so we can take a quick look at this application in the project and see that there's no there's no JavaScript here right it's just razor files and c-sharp let's go ahead and ctrl f5 so we can see what the application does these razor files the same razor files our developer has been using for the last nine years yeah so these are a combination of HTML and C sharp and it's use of dynamic dynamically render your application so I want to start I'm sorry start without the debugger and let's go ahead and then we'll see what this app does now this will be a simple spa style app like it'll have some interactivity some tabs you can tap around there we go so we have a home page account or fetch data page I can use the back and forward buttons in the browser so I can do client-side routing all those navigations are actually being intercepted in the browser by Blaser and then handled in the browser without the requests ever coming to the server the home page just has a little bit of static HTML nothing too exciting there the counter has this button that if I click the count goes up and there's no page refresh happening there it's all happening that like a client-side app would normally work and then we have fetch data and fetch data is conveniently enough showing a table of weather forecast data now how how is this working how is this possible there's no JavaScript in my project well that's F 12 and look at what is going on in the browser dev tool so I'm gonna refresh so we can see the network traffic and if you look here we can see that there's not much being downloaded it's only about 400 kilobytes of stuff but if we look at the little more carefully we see there's a WebSocket connection being set up between the browser and the server that WebSocket connection is being used to send all the UI events to our components that are running server-side which then executes the components figures out how the UI should be updated and sends the updates back down to the browser to be applied to the actual Dom so that's how it's working and we can we can see that in action let's look at the WebSocket connection a little more closely we'll clear all the messages they've been sent so far and I'm just gonna click you see that see the binary messages flying that's you I events being sent and UI updates being processed that's how that's all it's all happening now let's go look at how that code is actually implemented for that counter component here it is it's a razor syntax a combination of HTML and C sharp we can see it's routable because it has this app page directive at the top to say that the route for this component is slash counter we have some normal HTML markup and then we're using razor syntax to render the value of the current count we also have a button which has an onclick handler normally this would have to be JavaScript but here it's c-sharp we're pointing to a c-sharp method then whenever time the button is clicked the count gets updated the componentry renders and that's how you see those updates on the screen now each of these razor files is actually compiled into a just a normal dotnet class that captures the rendering logic from from the dot razor file and those component classes can be compiled into dotnet assemblies they can be then shared on new Guetta's nougat packages you can build a reusable component library after those component vendors we showed earlier can actually you know have these components we can actually just drop into our apps that's right it makes your life so much more productive you can just grab existing components and go let me show you how that's done how you can build your own component class libraries I'm gonna add a new project to this solution and this time instead of a blazer app I'm gonna pick a razor class library now what is that well a razor class library is actually just a normal dotnet standard class library but it's been set up to also be able to compile dot razor files to compile razor components here we have a razor component that's in the new class library it's pretty simple it's just a div but it does have some styling and this is interesting the the project has this WW root folder with a couple of static files it's kind of styles that CSS it's got a background image that's also used this is a new feature in asp.net core in dotnet course Rio where your class libraries can carry static files that then are made available to the application when the project is referenced or when the new get package is referenced so I'm going to add a reference to that class library like so so I can use that component now to make the these files available in my app I do have to add a link to the styles that I want and we use a simple convention to do that I'm gonna copy this existing link and I'm just going to update it so the convention is its underscore content is the the prefix and then the name of the class library so razor class library 1 and then the path to the file that you want so Styles dot CSS and that's all you got to do now we can use our component in our app so let's just start typing here component 1 I think is the name yep there's intellisense let's close that out we say just go back to the browser you can see that the browser already knows that the app has been changed we just refresh and so we can hopefully see the changes on the home page aha there is our styled component that came from that component class library easy so simple so that's gives us hopefully the basics that's not going to build that weather app I've already started it over here and this solutions we go into the blazer folder I'm gonna set the blazer server version of this app as the startup project there we go now this this blazer app is a little bit interesting in that there's no much in it like it actually doesn't have like hardly any RAZR files in the app project like hardly at all that's because it references this blazer weather core project down below that's a razor class library that contains all the components that's used by the Apple explain why we did that in just a bit but you can look in here and see there's the forecast that razor page and there's all the razor syntax that renders the app let's go ahead and run this let's see what the app looks like this app borrows the same beautiful design that James used for the mobile application there it is so looks pretty good we got the current temperature that's all working now let's look at the code and see how that is done at the top of this page it's got a route just like before it also is injecting an eye weather forecast service that's the same G RPC based service that Jane used using his mobile app same code like so yeah all the code runs everywhere browser mobile desktop anywhere you want and then we've got the razor markup that's just rendering out the the Dom elements for the for the page down below in this code block here's a component life cycle event that fires when the component has rendered and this is kicking off this get weather updates async process which is in this method down here here you see that think for each loop that we saw before who seen before so it's getting the live updates from the server we should be able to see that in the app if I let's zoom in here so 48:45 yeah so that the tics are coming in from the dating all right great now we're missing our ability to actually change the temperature units let's go ahead and fix that I already wrote a little temperature unit picker component it's another dot raiser file in the class library it's just a div let's expand it again it's just a div that has an onclick handler that when it's clicked it will toggle the units from Fahrenheit to Celsius and then it has this parameter temperature unit changed so it can let the parent component know so now we just need to use that so let's go back to our weather forecast page after the temperature let's add the temperature unit picker and we're going to add bind the temperature unit from that component to the temperature unit field in my page and that's all we should need to do I'm gonna control f5 again not control it for you no control it for does I was maybe search or something all right there we go so we're up and running and now we've got this little widget down here by the temperature I can click on it and you can see the temperature automatically updates between Celsius and Fahrenheit now that's a blazer server version of the app but when the cool things about blazer I'm gonna stop you and say we're gonna we're gonna stop on the blazer stuff and we can quickly talk about the webassembly thing so yeah I got you basically webassembly allows you to take these same applications and actually build them where all the code runs on the browser not on the server this is the same app same components it's just instead of running in a blazer server app on the server this is all executing client-side in the browser there's the web assembly file coming down with the app so you can host your app on the server or on the client and take advantage of both sides of the wire cool I am super excited with this blazer stuff this is like you know all my asp.net knowledge now lets me build spy applications without using any JavaScript at all if I want so super cool then full stack web development with dotnet ok let's switch back to the slides real quick when talk about one more big thing machine learning we introduced ml net at Build that's May of this year 1.0 they just shipped and I'm just gonna quickly talk about it and we're gonna bring Bree up and choke a couple demos the whole idea behind ml net is if you're a c-sharp developer you don't want to have to go out and use some other technology or some other language to go and build machine learning into your applications and so you can build ml models and stuff directly in C sharp F sharp without having to go anywhere else we also know that it's hard to actually build you know machine learning models and so we have an awesome preview tool called model builder that you can use to actually just point out some of your data tell it what you want to predict and it'll actually go and write all the code and models for you Bri is going to show that and then finally we want to make sure that anything that we do in ml net it can be extended with all the mo buzzwords you've heard like tensorflow and stuff so what I'm gonna do next is bringing Bri up on stage and what we're gonna do is we're gonna build a yeah come on we're gonna build a machine learning application that does weather as well yes we are so if we take a look we still have Dan's Blaser app up on here but what we're gonna do is actually make this app smarter using ml net all it does is it right now is it pulls weather data from from Glenn's micro service that's hosted in a Draper Nettie's but we're gonna use machine learning to take images from around the city and actually predict if it's sunny cloudy or rainy so it's gonna predict the weather because we all know that the weather is not always accurate you're better off going and looking yourself to see if it's actually right exactly so we'll close out of all these over here all right so if we go back to let's see the forecast appraisers that we saw before all right so Dan talk a little bit about components which are just UI elements that you can have in your plays or applications and I creative one of those for the machine learning and I just called it ml weather cam that's just gonna go right below the weather data that we saw before and then what this does is it if we look at this ml weather cam don't raise ur right here there's gonna be three buttons that are gonna link to three separate photos which are then going to be put into this classify weather method and if we go to the app it's gonna show you a couple pictures that we got from cams around the area and then it tells us kind of what it thinks those cams are showing us whether it's rainy or sunny or or what not exactly so here you can see there's nothing really implemented right now we just have it returning a string so if we go ahead and run this real quick you give it a second and we'll see that new component added on there it's just when you click on it oh you know what actually we're gonna try it on the server version instead because that's where it's implemented so let's retry that mm-hmm Dan caught you up yeah he really did he really did let me try this again so we're gonna rebuild our solution and it'll take just a second just I want to show you that it's implemented without the machine learning service or machine learning yeah examine the application will show the pictures yeah and then we'll run model builder to go and create the actual model for us right exactly so should never rebuilt the full solution but get a second the big solution is it's a big solution yeah something I should talk about is you know while we have the solution we're actually gonna make this entire all the demos we have the day I'll be available on github later today right exactly buddy watch that keynote can actually do this himself and so here are the three pictures that I was talking about here's that new component and of course it's just returning the same every time so to add machine learning we're just going to use model builder which is UI tool and Visual Studio it's just an extension that you can download once you download that extension you add machine learning and there's a variety of scenarios here that you can see like sentiment analysis price prediction but we're going to do image classification because we want to predict the weather and images so then we'll choose our training data which is how you create the machine learning model in this case I've already put it in the format that it needs to be with three different labels here and we can actually see once we choose that that I have my images here a preview of my images for cloudy rainy and sunny you gave it a bunch of images to learn from great and I'm gonna have it train for about 90 seconds because it's a small data set with larger data sets you want it to train for a little bit longer so this this this whole tool kind of makes me laugh I remember a year or two ago we were building a demo in the team it was a it was called github classifier and what get up classifier did is it basically looked at the issues were being filed in our github repos and would automatically classify them to the right places it's kind of a bots I remember sitting on my team and I was looking at the code and I'm like I don't know if I'd ever be able to write that code and it's kind of the genesis of a model builder thing I couldn't figure out how to write the code and then the next thing was I remember asking the team well how did you choose the algorithm and the answer kind of was well we tried this one and it seemed to work and to me model builder is like taking that to the next step further where you basically instead of doing that give me a data file of existing data run this tool on it it will try things doing it right now it's trying all the different algorithms we have in ml nets and will write the code for me mm-hm so you're making ml where I can use the code right yeah so building and fine-tuning the performance of a machine learning algorithm can be really difficult especially if you don't have that machine learning knowledge so what model builder does is use automated machine learning or auto ml for short to explore different algorithms and settings to give you the best model based on your scenario and your data so it's really really cool because you don't have to have that machine learning knowledge and as well you're showing the graphical version of this inside of Visual Studio but if I am on a map or on a Linux machine I can also drop the command line and run the same tool that you're running with inside of Visual Studio on all those platforms as well right exactly so if you you don't use Visual Studio you can actually use this ml net CLI and any command prompt which is really nice so it's done training we're gonna head over to evaluate screen it actually found this one model here which uses a resonant neural network architecture for that image classification and we'll move on here and so it's really nice as once you have your trained model you can add your projects and if we zoom in here give it a second you can see that there's this console app here which is actually where the model training code is then you have your model consumption code and your actual serialized zip file which is the model so if we come back out here and now if we go back to model builder you can see it gave you the code for consumption right here all you have to do is copy this code and go back to our weather classifier will uncomment the name space that model are actually adds the reference to the model for you and right here so we've created our input we're going to set the file path here it's a full path and then we're going to actually load this into here and return result dot prediction and so actually we're gonna add the reference here because I think it was added to the wrong no it's there let's see what it's giving us here Oh so we've got our Weather Service ml dot model Oh what we have to do is actually I think I called it on the wrong one projects yeah the wrong project it actually needs to be called on this project so whichever project you add machine learning to it'll add that reference to automatically but since I did it on the wrong one we're just going to add the model here and then we'll so then sorry it's a mouse I'm not really used to here so we're gonna do input dot image source equals full path and then we'll be able to do about that all right so now we can see that it detects this CenturyLink Field is cloudy Paramount Theater is looking a little bit rainy and Golden Gardens park is looking sunny so in less than five minutes we were able to use ml net and modelbuilder to add machine learning to this blazer application which is really really cool that's amazing let's go back to the slides and we'll talk about IOT so IOT kind of a new space in net ionic core kind of enabled us by being able to run on different platforms and architectures and so the big thing here is you can run dotnet core on all these small devices where I raspberry PI's including all about net you can run asp.net on these things we have a GPIO library for reading and writing data to some cool hardware that Richards going to show us and you can actually deploy these applications to IOT either directly on the device or using a container on the device so let's switch over here and bring rich on and let's talk about IOT and dotnet hey Scott so this is more of a Show and Tell type of setup today so we we have a Raspberry Pi right here so this is a Raspberry Pi 3 actually and it's got this hat on it sometimes they're called shields but this is a hat or a bonnet and this is controlling this set of led matrices so actually there's four of them here it's really hard to tell because I did such a good job making this set up but there's actually four of these and it's all c-sharp code that is running this from from top to bottom and so the the libraries that we built actually are able to figure out like the address translation to deal with the fact that there's four of these and they're kind of like in this set up and so it's kind of cool we've got a message here about Dona Kampf that's kind of one row then we have this other one with the time then we built a analog clock an analog clock and you can see this isn't an image this is actually a code driven I'm watching the second hand go around and in real time it's amazing yeah so this is this is how you're staying on track right so this is actually a kind of a canvas and then it's actually raining in Seattle this won't be much of a surprise you're following the same service that we showed everywhere else right absolutely right great exactly and then so it's showing it's raining so really what this is demonstrating is this device is like really low powered compared to you know like Intel x64 blah blah blah machines that we've been used to and it's showing that yep you can write c-sharp run it on here and it's capable of like doing a lot of things at once that's the cool part about c-sharp and net is you can actually run it on what arm 32 arm 64 but if you want you can also run it on the big Intel CPUs as well yeah and and it's all the same the other thing is because it's all c-sharp it means that you can actually use the c-sharp debugger that you're used to using a lot of the other solutions out there depend on native libraries and some of those are GPL ours is MIT so it's super attractive to people that work in this county ecosystem cool I'm still super excited by this because we never could have done this five years ago oh yeah totally this is this is definitely new so but we're I'm really happy - happy awesome - thank you back to the slides real quick and I want to happen to be really cool dotnet core is all open source and even though it's open source we actually want to consume some of the open source libraries so there's a couple of references you've heard today like gr PC gr PC is an open source project and we Microsoft have been contributing to that to that project our engineers are working on that project to make sure that the c-sharp support there is first-class at the same time I mentioned earlier identity server identity server is an open source project that helps you add authentication to your AP is and dotnet core we are actually contributing to identity server we actually are helping fund them as a sponsor of their project giving them money you know G RPC we're giving them code identity server we're giving them money via github and then also swashbuckle which is a common library for building swagger for dotnet poor projects if you want to if you want to use any of our rest stuff we can generate rest in points the same way we generated those G RPC endpoints to do that you have to have a library like swashbuckle and so I'm happy to announce that we're also helping fund them as well dotnet 5 so we just shipped out into core 3 and of course the team is super excited we're working on that core 3.1 right now but I want to briefly talk about that net 5 - so you know after that in core 3 the next big thing is you know we talked about xamarin and we talked about dotnet core what if we put all that together into a single framework and so dotnet 5 is the genesis of this the next the next iteration of dotnet will be done at 5 and the idea here is all the runtimes collapsed so we have one common set of runtimes we have one BCL that sits on top of that and then we have all the app models on top of this and so in the.net 5 wave they'll just be one dotnet not multiple nets let's talk about our schedule so we just shipped a technique or three today dotnet core 3.1 is going to ship in late November early December that'll be our LTS that's our one if you want long-term support but we're gonna go way beyond that we want to make dotnet predictable so you can see here now dot at five will ship next November dotnet six will ship to November afterwards so on and so on and so on each of these nets every other year will be an LTS so it's very clear which ones are long-term supported and which ones are faster but we're trying to make it easier for you to consume nets and understand the schedule I do want to do one quick thing I'm going to grab my laptop slide it over here I thought I would do one demo of some of the tech that we have coming in dot net five and so Dan showed the blazer wrap I'll you show the desktop app James showed the the the xamarin app and Bri showed the ml app well we want to take the step this stuff even even further so we're gonna switch to my laptop here he jump out of presenter mode get my laptop back and I want to show a preview of one of the things we're thinking about in dotnet 5 so I'm gonna run that same blazer app that Dan showed but now what I've done is I've actually wrapped it in an electron shell electron is the technology we use to take make things like Visual Studio code run on the desktop and so now you see that same exact web weather application running it's it's it's a blazer application so it's web but it's now running in a desktop window it's got file menus I can do file and exit this is one of the examples of the technology we'll bring in the.net 5 wave so I want to close with one thing here which is we have an awesome unified platform you can build every type of application on dotnet core my advice to customers today with the shipping of dotnet core 3 if you're building new applications build them on top of the core 3 it now has all the capabilities that should be important for modern applications if you have existing applications you're likely should keep them on net framework there's no reason to move them off of Dutton and framework dotnet framework is going to be supported forever so new applications are done at core 3 leave your existing applications where they are everything that I'm showing here is downloadable today and I want to thank everybody very much go get the bits and build some new applications on tanja core thank you very much

Building Bots Part 1

it's about time we did a toolbox episode on BOTS hi welcome to visual studio toolbox I'm your host Robert green and jo...