 Hi, I'm Scott Hunter and I'm here today to talk about .NET, especially .NET Core. Today, we just released .NET Core 2.0, and you can grab it today at dot.net slash core. Go out there and grab it right now. For the next hour or so, I'm going to go through all the new features, all the new cool things in .NET Core that you wanted to check out. So first off, before we even get into that, we have our virtual conference, .NET Conf, which comes out September 19th of 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 .NETconf.net and we will see you there. Next, let's jump into .NET Core 2.0. I think .NET Core 2.0 is the first real release. We shipped .NET Core 1.0 last summer and it was a great version, but it had preview tooling and we got feedback from customers that all the APIs were not there. So, .NET Core 2.0 kind of rusts over all the rough edges. The coolest thing is, as part of .NET Core 1.0, we talked about how ASP.NET Core was one of the fastest web frameworks on the planet. We've made .NET even faster in .NET Core 2.0. So now, a web app is about 20 percent faster depending on how you run it. Dan Roth is going to talk about that a little bit later today. More APIs. One of the biggest feedbacks we got on .NET Core 1.0 was, hey, a lot of my favorite APIs, the old .NET APIs I'm used to, things like datasets are not there. They're all back. We have a bunch of new project templates. So now, if you want to build an Angular app with ASP.NET Core or a React app with ASP.NET Core, those are all in the product. More distros. One of the cool features of .NET 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 2.0, and even better, for a developer, we have the ability to target generic Linux. That means you can actually run .NET Core 2.0 on most Linux's without even installing a specific version for that particular Linux. Simplified packaging. If you follow this in .NET Core 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 ends up 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 guess which APIs are in which packages, and so now we made it very simple. In ASP.NET, you reference one package. For .NET 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 VS for Mac support as well. So everything I show in .NET Core 2.0, 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 .NET Core 2.0, just a couple of days after we ship, Red Hat will have the Red Hat version of .NET Core 2.0 as well. They have a great no-cost developer license that you can grab at the URL here to try .NET Core 2.0 on Red Hat. So I'm really excited to have Red Hat following us so quickly into the 20 wave. Let's talk about 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 source .NET Core, we had no idea what the reaction was going to be. Was the community going to come join us and help grow .NET? 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. Even better, you can see that we've had a bunch of cool companies embrace us because of this. Samsung is building their Tizen platform for their televisions, their mobile devices, and their appliances and wristwatches on .NET Core. So you can actually use .NET to program all those things. We have Illyard Games. They moved the game, they were building their own web server in .NET. They recognize one day that we were trying to make .NET Core super high performance. So instead of trying to build a competing web stack, they actually came and helped us make .NET Core way, way faster. So when you see the tech and power benchmark, where we scored really well last November, Illyard Games helped us a whole bunch. You can see here as well, we have a foundation, a .NET Foundation by big people in the industry. You can see we have Red Hat, Samsung, JetBrains, Unity 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 .NET standard. This is my favorite part of .NET Core and .NET and even Xamarin. When we started working on .NET Core a couple of years ago, one of the challenges we had with .NET was there's lots of .NETs. There's .NET framework, there's Xamarin, there was .NET Core, there's Mono, there's lots of .NETs out there in the world, and they each had different sets of APIs. So we said as the .NET team, let's stop this. We want .NET to be consistent across all platforms. So just like HTML5 is a specification for web applications, .NET standard is a specification for .NET. What that means is if you're a .NET platform, and you want to be known as a .NET platform, you have to implement the .NET standard. That's basically a contract of a bunch of APIs. So any .NET that we consider a real .NET that implements .NET standard has to have all those APIs. That's pretty cool because it means you can easily move your code from a Xamarin app to a .NET Core app, to a .NET framework application, and later this year with RS3 of Windows, you'll be able to do the same thing with UWP applications as well. So let's look what that looks like. What we basically did with .NET standard 2.0 is we added about 20,000 APIs back. We took the intersection of all the APIs that were in Xamarin, and all the APIs that were in .NET framework, and use that as the basis of what this would look like. Then we went through and added all those APIs back to .NET Core 2.0. So much bigger surface area. The other cool thing about .NET standard 2 is when we look, 70 percent of all the NuGet packages in NuGet.org, actually support .NET standard 2.0 today, which means especially as an ASPnet developer or .NET Core developer, a lot more of those NuGet 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 percent that don't work, well, they're referencing things like Windows Forms, or WPF, or technologies that don't exist on all the .NET platforms. The other cool thing about the .NET 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 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 .NET standard 2.0. Here's an example, if you're a .NET 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 of serialization came back, all the networking stacks came back, all of IO, 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 past code, and they all work great with .NET standard 2. So let's do a quick demo. So what I have here is I have an ASP.NET Core 1.1 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, it's been out there for a long time. So let's try to reference this in my ASP.NET Core 1.1 project. So I'll bring up the Nuke Package Manager here, we'll go browse, find sharp zip lib, and I'm going to add this to my project, and notice that the package restore failed and it rolled back. That happened because .NET Core 1.0 did not support the APIs required for sharp zip lib to work. So let's instead, let's move to a .NET Core 2 project here. So I've got a .NET Core 2 project here, I'll do the same thing again, and first off just to show this off a little bit, I'm going to add the .csproj file, and you can see this is using .NET Core 2.0. I'm going to zoom in a little bit here. This is a .NET Core 2.0 application, and because it's .NET Core 2, I can come back, do the same example, and say manage Nuke Packages. I can browse, and let's find sharp zip lib, and I'm going to add it, and this time because we added all those APIs back, notice I'm now getting the dialogue saying this is going to succeed. The Nuke Package is added, and I should be able to do a build here. Successfully added, restoring, let's do a build, and everything works great. So this is showing you that now I can take a .NET Core 2.0 application, and because of .NET Standard 2, and the support we have for that, suddenly all this existing code out there is available to my apps. So that's .NET 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, because we're always focusing on new web frameworks or new libraries to bring into .NET, 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 that have fixed performance problems in low-level pieces of .NET 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. Then obviously, we're running the same jitters that we are on the full framework on .NET Core as well. One of my favorite examples here is Regan. They have a product called Regan.io, and they used a node-based back-end a couple of years ago. I ran into them and talked to them about .NET Core at the time, and said, hey, we're doing all this perf work. They actually took their same application, which was doing 1,000 requests per second on node.js, moved it to .NET Core, and we're able to get 20,000 requests a second. That's mainly because they are an IO heavy application, and we can do more background IO than node can. So that's 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 visualstudio.com, and we're going to talk a little bit about what's new in it. First off, better together. .NET Core plus VS is an awesome tool for building applications. We have full support for .NET Core 2.0 and 15.3, and we also have full support for .NET Standard 2.0. .NET Standard 2.0 can be used in your WinForm apps, your WPF apps, your ASP.NET apps, your ASP.NET Core apps, your console apps, everything can use .NET Standard 2.0. The other thing we did is we made it very simple to have 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. 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 Visual Studio 2017-15.3 is we have CI-CD support for containers. This means if you're building containers in.NET Core, you can basically go through a wizard and have a CI-CD pipeline set up using VSTS, which will either target Azure App Service or our Azure 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 in App Service or the land in a Container Registry all built in. Another cool feature that we shipped in March with Visual Studio 2017 RTM was live unit testing. The idea behind this was today, typically, you do test as an afterthought. You write some code for a while, and then at some point you run your tests. Also, because it's 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. So the idea behind live unit testing is, as you're developing, you can see live 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. You get some great visual coverage in the IDE. So that's live unit testing. Next, what 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 live unit testing. So let me introduce Casey from the team. She works on.NET productivity and the tooling for.NET. Yeah. Hi, guys. I'm here to show you how Visual Studio 2017 is 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.NET projects also for.NET Core. Yeah. So for the first time ever, we brought live unit testing over to.NET Core. Yeah. I think you're going to show the new project system as well. Yeah. So you'll see all code analysis. I'll show you a little bit of the new project system and a bunch of different things that you can do in.NET Core. Cool. So here I just have a simple.NET Core 2.0 app. It's basically just lets me yell at my Alexa in the morning to figure out when my boss is coming. The first thing I want to do is show file globbing. So file 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 in my solution explorer. So there's this automatic syncing between the file and solution explorer now. No more add existing file. Yeah. So you don't have to manually add the file yourself and sort of want to merge from source control and things like that. Can you open the CS-proj file as well? Yeah. I can also show you the new CS-proj file. So rather than having to unload a project and reload it to edit your CS-proj file, you can now just do it directly from here. So I can click on this and you'll see that the new CS-proj file for.NET 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. Files are not there. Awesome. Which means, which will save you a ton of time when you have a ton of merged conflicts in your CS-proj file from all the different files that you and your team have added and removed. That's super cool. Yeah. So those are just some of the productivity enhancements that we've done for.NET Core projects specifically. You'll notice in this direction file that I added that I have a merge conflict in here. So to resolve it, we added actually a ton of new refactoring in Visual Studio 2017. And you can see here I can choose to take the head, the upstream, or both of the changes that I had. And so here I just want to take the head. And again, I access this refactoring with control dot. And now it's resolved this merge conflict for me. All right. So probably my favorite thing that we've added is actually a feature we've had for a while, but now we've remapped it and renamed it, is control 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 that I want to go to this type that I have called bus helper. So I can just use camel case matching to just type in 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.NET 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 figure out what is the smallest number of tests I can run so that my unit tests run in a reasonable amount of time, but also a big enough set that I can feel confident that 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 compromise is between small number and the biggest number 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 tests. 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 in line 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 this line of code is hit by all passing tests and a blue dash means this line is not covered by any tests at all. To me, this is the coolest feature is just being that quick visualization of what I have tested, what I don't have tested, what's failing, would I have to open up other windows or run other stuff? Yeah, you never have to lose the context of your development to see the impacts of your changes. That's awesome. You can click on an 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 to debug this test. So this is all in .NET Core, so we have all the same debugging support, live unit testing support for .NET Core projects that we have with all the rest of the .NET projects. So I've actually hit a break point here and then debugging a new feature that we added in Visual Studio 2017 is run to click where if you hover next to different lines, there's a little icon that pops up. I can zoom in to show you that where I can say run 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 the 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 an old reference exception, so it would be nice if I knew what was null. And this is actually telling me that the lat variable is null. So now I know exactly what I need to do. Don't have to scroll through all the error text to go find that error anymore. Yep, I don't need to restart my debugging session to figure out and step into different things. So again, as I was talking about, we added a ton of newer factorings in Visual Studio 2017. So I can just come directly up to my parameter list and press control dot. And now I have the option to add a null check for this parameter. I can do the same for my longitude parameter as well. And now on a single click, I've added all this boilerplate to actually test my, or do my null checks for me without me having to think about it. I don't notice as I did that, live unit testing figured out what test was impacted by my change, ran them for me and updated in the editor in the context of my development. So let me know that now all my tests are passing. That's what's pretty great about live unit testing. That's pretty amazing. Yeah. So now that we've shown debugging and some refactorings, let's show a couple more. So it just so happens. So I'm gonna use again, control T to go to any place that I want. So I'm gonna go to the file called stop. So I'm gonna put an F to filter by files and then 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 stop you go to. Learned that the hard way when I first moved to Seattle. So what I'm gonna do here is now my stops are gonna have directions associated with them. So I need to actually add a parameter to my constructor. So do that, I'm gonna type direction and you'll notice now visual studio is actually suggesting a variable name for me for this parameter. So it's like, hey, you got a direction you probably actually just wanna name this parameter direction and I can just 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 null 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 I actually added this for my serialization, I have to add a JSON converter. So again, you can do the camel case matching in here. So I can type JSONC and they can see all the different things that match type of and again, use the camel case matching to help me autocomplete this. Now, live 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 gonna go to find all 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 in 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, figured out the test that needed 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 what 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 hint best practices or alternate coding patterns to developers. So if I investigate here, you can see that's taught 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 for the project and everybody has to adhere to those rules either as warnings or errors or whatnot. And so we actually allow you to like code file 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 .NET code style. And so you can see here all my different var preferences. So I've chosen for built-in type someone the type is apparent to use var otherwise I want you to use the explicit type. And you can configure this at the directory level. So if you want to add the project or the solution level you can do those kind of things as long as it's in that directory. You'll also notice in here that when I actually converted to the explicit type I've used a C sharp seven tuple 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 it's telling me, hey, I've named my tuple elements route and stop. 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 new language features. But the other thing that they're 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 a live analyzers in the code so you can get live feedback inside the editor on different code violation. Yeah, for people to use those before that used to be an external tool that you ran statically against your code. And now with live being as an analyzer it's live in the product so you don't have to actually do an extra step it just runs all the time. And so here's an example of one is 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. And we went through all the FX cop rules and took the ones that we thought were most pertinent today and those ones were 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 that I have installed here. And the last thing I want to show is we have all these gray dotted lines going on the editor here which are indent guides. This allows me to hover over and just kind of get a better idea of like a map kind of of my code. And so I can see here that I have another class besides bus helpers in here I have a class called my stop info which is basically what my file is named so I'm just gonna 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 and again well if you notice this 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 .NET development awesome. Those are awesome. Thank you very much Casey. Yeah, thank you. Okay, so now we're gonna move on and do Azure functions in Visual Studio. So there's been this huge push in the last year or 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 wanna run when something happens in the cloud whether a REST API gets called or you have a trigger that's fired from a event or a file is added to a storage account something like that. That's this new model of programming called serverless computing. And we wanna make sure that C sharp .NET and Visual Studio 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 in Visual Studio. And this tooling is pretty cool. You can basically build C sharp functions and what makes the tooling so awesome is you can actually develop them locally first. We have an 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 support of C sharp, all the tooling, all the cool features that Casey showed. They all work with Azure Functions now. And so next I'm gonna bring Andrew Hall up and he's gonna do a quick demo of Azure Functions. That's cool. So this is Andrew Hall. Andrew works on Visual Studio Tooling all up for .NET. And today let's talk about Azure 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 but 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 of megabytes to the installation. So just check Azure Development and you're good to go. Just check Azure Development and 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 empty project and I have two files. So one is host.json that I can configure settings. This is all documented online but we're gonna go ahead and build a queue trigger. So when we push things into a queue we're gonna pick those messages 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 relatively quickly. Explain to people what this means is I've got a Azure table, table storage set up in the cloud and I've got a queue inside of that and you're saying that anytime somebody puts an event into that queue it's gonna call your code. That's correct. And so one of the great things about Visual Studio is we have a schema. You can see we know the schema for host.json that we've created and I can configure settings. So for example I mentioned what this max polling interval is gonna do is it's gonna 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 Studio's 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 and I get the IntelliSense that I would expect in Visual Studio's first class JSON editor. Let's go ahead and back back out of that. The second thing I have is a local settings.json file and what this is, is this is a file that lets me specify things like connection strings or whatever. It's by default gonna be excluded from source control because it's supposed to be your local settings. So the default git ignore that gets dropped with this will prevent that from going to source control. But in this particular case I've populated a required property Azure WebJobStore just as the required storage account for working with Azure 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 pulley interval set up to make sure that it's gonna pick up quickly. Let's right click on this and let's say add. Let's add a new item and we're gonna pick the Azure function template. So let's call this, what should we call this? Let's call this our queue trigger. It's gonna bring up dialogue. So let's go ahead and pick our queue. So you have a whole bunch of types there. So I'm seeing blobs, event hub, generic web hook, HTTP triggers. Wow, lots of services in Azure. Yeah, so 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, now on the portal by default you're working with C sharp script files, so.csx. As you already told people in the introduction one of the things that we've done in Visual Studio is we've made these class libraries that give you a first class development experience. It also gives you better startup performance in Azure because we've already done the work on the client side to compile that into a DLL. So you're not going from source every time. So that's the face locator? What does that do? Face locator, I believe this is a cognitive service that actually finds faces 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 it's not waste. You can spend a lot of valuable time playing with creating your own Azure 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 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 having to be something you have to go install separately. So let's call this our Q trigger, and we have a connection string here. So this was the, we'll use our Azure web job storage here, Azure web jobs storage, and the path is my Q items. This is going to be the name of the Q. So if I go over here, I have storage explorer open, and I can see that I'm going to use this Andre Howe channel nine. I can look at my Qs, and I can see that I have my Qs 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.3 after I create this. For people to watch this, if you see Azure 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 when I do this exact same demo, I connect that thing first, and then copy my connection string from Azure Storage Explorer into VS. Yeah, and that's exactly what I did. That's a really good point. I went cooking show style a little bit. I have my pie in the oven with 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 Qtrigger.cs file for the pre-compiled function is we've moved away from a world where you're mapping between your Azure function and what you're gonna trigger off of the information is decoupled. So if you look in the portal, for example, for Azure functions, you have a .csx file, and then you have a separate function.json file where you specify all the information of what is the connection string and what is the queue that you're gonna 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 name. So the function name attribute indicates that this is gonna be an Azure function. So that's how the runtime will find it, the presence of that attribute. All the configurations being moved to 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, no more decoupling of those things. Cool, that'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 Azure 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 queue and let's push a new message into the queue and I'm gonna expect that that breakpoint's gonna be hit. So let's say, hey Scott, we'll push that into the queue. And within a second, I've hit in Visual Studio and that's why I upped that polling interval just to make sure that happened quickly. And if I look at the my queue item that's been pulled from the queue, I can see my string that says, hey Scott. So this is the message we just pushed into the queue ourselves. Super cool, easy. So let's say that we're 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 have 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 gonna go ahead and create a new Azure Function app. So I'll click my publish button there and you can see there's gonna query my subscription. It's gonna populate some information from the cloud. It's gonna show me my options. Resource Group, I created a channel nine resource group that we're gonna use for this. I wanna create a new app service plan in this case. I wanna show one of the powers of functions is this consumption plan. And consumption plan is only available for serverless computing, but what this means instead of these machines where I have dedicated resources and I have a cost associated with paying for dedicated resources, the consumption plan is only gonna charge me by the millisecond that my application runs. This is really the benefit of serverless computing is I only pay for what I use. Correct. And so we're gonna go ahead and pick this same storage account we were working off before, which is my channel nine 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 gonna copy this application up to the cloud and it should be running up in Azure. We should have the ability to go hit it. So you can see that we're on step two of three. So this will take a couple seconds. Yeah, I'm making assets in the cloud, then it's gonna copy your stuff up at the cloud. And then once you're done, we can run and see all that kind of stuff. Perfect. So now I have a summary. I can see that I've been successful. So let's go to my Azure portal. I'm gonna 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 this, it's gonna populate. So I can go into my QTrigger function. And so this is showing me the, just 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 queue, which says, this is the cloud. And I click okay. When I come back to the portal, I can see that the message I just had is this is the cloud. So from Visual Studio, I took my function app. I compiled it as a DLL. I was able to right click publish it directly to Azure and it's now running in Azure and it's gonna fire and execute any time that the events that I've chosen to trigger off of. You're only paying for when it's called. And we're not gonna show it, but if I wanted to, I could also open the Cloud Explorer on Visual Studio, found that same function and attach the debugger to it right from Visual Studio. 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. Azure functions. Okay, let's move on from functions. The next thing I wanna talk about is we just today also shipped Visual Studio for Mac version 7.1. You can also download this today at visualstudio.com. What's cool about this is Visual Studio for Mac has full support for .NET Core 2.0. You can build console apps, API apps, web apps all with Visual Studio for Mac. And it's got full support for .NET Standard 2.0 as well. So all the stuff that I was showing in Visual Studio for Windows, you can do in Visual Studio for Mac. Next I'm gonna have James come out and we're gonna show Visual Studio for Mac. Okay, so I'm happy to introduce James from the mobile developer tools team, working on Xamarin and Visual Studio 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 it. Yeah, me too, I want to show a hard example. So we could have done File New and built that and copied it from my machine years 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 test, I've got a back end, a front end. Let's run this thing. It's a real app. I can click, see users, data 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? Yeah, sounds good. Often I'm working in 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 machines. So you've got a zip file, memory 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 Studio 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 moving the HTML, the CSS, the JSON 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 double-tap the solution. And let's see here, 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's restoring all of my packages because you're kind enough to delete all of the new packages. So it's a nice small zip which is nice. And what we can see is we have the same exact folder structure, file, structure and intact. So every single project 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, it's going to build up my .NET Core 2 application and then deploy it hopefully just like we saw just over there. So let's give it its building, building, building because this is fresh and it's a big app. And I like that you didn't just do File Nuke because that'd be way too easy, right? There we go. Launch into the browser. There we go. Local host 5000. Loads up. Visitors. Loads up my records. And there we go. The same exact app. So you and I could be working in source control together and 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 that's 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, TVOS. And right here is the .NET Core applications from libraries, ASP.NET Core, and of course, libraries. Right here I can come in, create a .NET standard library. Right, awesome. Right here if I go in and I say, oh, what do I want to target? .NET standard 2.0. That is a single library that I can then share between all of not only my ASP.NET Core, .NET Core, my Xamarin applications and UWP applications too. So kind of everything. Now when we talk about getting started, it couldn't be easier. Let's say I just wanted to create a blank console application. I can come in, pick between F-sharp or C-sharp. I'm a C-sharp guy, so I'm gonna say C-sharp. And again, kind of a very similar flow of what flavor of .NET Core do I want? And of course I want .NET Core 2. So let's say awesome.NET Core 2. Now what this will do is it'll go off. And just like we saw earlier, it's gonna go. We'll see all of our dependencies here are SDK and we can see that we have our- 2.0 SDK. 2.0 SDK. Now at this point, I can just simply go ahead and hit a break point, set a break point on Hello World, command line comes up. And in just a few seconds, debugging a .NET Core application right there. Here we go, stop debugging from the console. 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 now scaffold out and bring in all my dependencies in NuGet and SDKs. But we're gonna come in and we can look at our pages that are here. So if I wanna go into my about page, I have my CSHTML, 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 wanna come into your web route, 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 there. This is the same CSS header from Visual Studio for Windows, so. Brought right over. So now again, just like we saw with your application, I can come in. I can start actually building my application, deploying my very first, I love RazerPage, it's 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 build my web apps in VS for Windows, VS for Mac. Great experience. And you nailed on the head actually. I wanna talk about one final thing while I have the stage. Is that often I'm building back ends with .NET Core and ASP.NET Core with web APIs for my mobile applications. And we made it drop that simple for developers to create a full multi-application. So under multi-platform here, I can select Xamarin.Form XAML 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 scaffolds out a full master detail application, brings in master detail shared code for your mobile apps, a .NET 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 an iOS and a web as my startup projects. What's 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 and my web app. I have the service running and the mobile app running at the same time. Exactly. So when I hit debug, what we're gonna see is that the iOS simulator is gonna pop up, it's gonna launch my application at the same time over here, launch my actual website. And here it's actually gonna start hitting breakpoints so we'll actually let it spin up fully as we add some items. There we go. So we have an item here, we have a website here and I can actually go slash API slash item. And we see we have one item, C sharp is very sharp over here, C sharp is very sharp. Now this is cool when I hit add, let's hit and add new item here. And I'm actually break pointing inside of the iOS project, right when I add that item, I'll serialize it, send it out to my backend. 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. And as I can continue on, we can see that the actual item is now added not only in the iOS app, but here, right there. Now when I'm all done, guess what you can do? You can right click, publish and publish to Azure. So I need to put that actual ASP.NET core application right up into Azure. I've logged in with my Azure account so to query 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 in Visual Studio for Windows, same experience in Visual Studio for Mac. That is a great experience. We think developers are gonna love it. So go to Visual Studio.com and download VS for Mac today. So let's move on. Next thing is ASP.NET Core 2.0. Lots of good stuff in ASP.NET Core 2. First off, faster in certain circumstances like running the tech and power benchmarks, it's about 20% faster than ASP.NET 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 wanna go get stuff to the web quickly or you just wanna write an API, sometimes a simpler programming model might be more interesting and so that's what Razor Pages is. I'm gonna have Dan come up in a second and show that. We've also added support for C-Sharp 7.1 to Razor. So when you use Razor in ASP.NET Core 2.0, 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 of that in a second as well. And this is, 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 built a lot of capabilities into.NET Core 2.0 that enabled this to happen automatically in 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 ASP.NET Core back end as well. So it's all wired together, so it's a great starting place. And then we always want our templates to give people best practices and so most of us probably use Two Factor Roth 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 ASP.NET Core. So if you wanna build applications for your company and have them support Two Factor Roth authentication, we've got great support for all of those applications. So next I'm gonna have Dan Roth come up. So I wanted to introduce Dan Roth from the ASP.NET team. He's here today with me to talk about ASP.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 ASP.NET Core application I was showing before that I added the old library from. So it's, you know, without any standard. But what I wanna show is I'm gonna publish this app to the cloud and show this new diagnostic feature. Sweet. So let's go over here and right click on our app. We'll publish, click publish. So this is gonna help me diagnose my problems when my app is live. Yes. So some of the feedback we got with ASP.NET Core 1.1 was we'd put app insights directly into the project templates. And so some people complain there's app insights, NuGet packages. There's some stuff inside of my web app. They were just trying to help. I know we're trying to help. And so what we've done in ASP.NET Core 2.0 all those same features exist. But if I look, there is no app insights in NuGet packages in my application. We'll just go and show that real quick. Oops, here comes the browser, showing my live app. If I go look at my dependencies and I look at NuGet, there is no app insights there. So we took it out. So let's go under that. So it's gone. So my app's running up in the cloud. Now what I'm gonna do is I'm gonna go to the portal and here's my app and I'm gonna click on it. And once it loads up in the portal something new is gonna happen here. Notice this banner that shows up at the top here. Click here to access app insights for monitoring and profiling your ASP.NET Core application. So instead of having to install app insights in my project inside of Visual Studio I can now inject it right from the portal. So I'm gonna click that button. So this is without any like adding any packages or code to the actual application. No packages, no code, nothing. Just go right to the portal and say because typically maybe my developers already published and I need these insights. I just go and let's enable it. And this is gonna create a app insights for my application and it's gonna wire up all the new diagnostics. So give it a second to finish that. And notice once that happened a 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 gonna actually load those app insight NuGet packages that we did not install in the actual app on my developer machine. Okay, so like it'll light it up. It'll just like. It just lights it up. Bolt it on after the fact. So let's watch here, it's interpreting my application. Take a few seconds. Okay. So I'm gonna 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 NuGet package and hook some stuff up. So I'm just gonna 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 app is still running. That's been successful. So let's go to log stream and what's gonna happen now is the portal is gonna connect to the logging in my ASP.NET 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 iLogger and Logger Factory? It's just wired up. Just wired up. So 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 to set the 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 we'll hope things are hooked up here. Like provisioning some app insights resources. 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. 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 a minute or so for data to start flowing through. But the cool thing here is now developers can publish their apps to Azure without having any app insights configuration turned on. Right from the portal they can set 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 flow through automatically. Just by publishing to Azure. Just by publishing to Azure. Logging and diagnostics. So at this point let's flip over to you and I think you're going to show us what razor pages. Yeah I'm going to show you creating an application with ASP.NET Core 2.0. So ASP.NET 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 Visual Studio I've already created an ASP.NET Core 2.0 application. This is just an empty web app and I just want to build some UI. But let me show you some of the things. This is a little different. I see a pages folder there. Yeah that's where we're going to add our pages. But I want to show you a few things first that are simpler now in this model. Like if I show you the CS Proj file for this application, you 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 that's all you got to do. And literally everything's there. If you want to reference individual packages, they're all still there. If I expand the node in the Solution Explorer, you can see them all. Now you might worry like, isn't this going to make package restore like crazy slow? No, because all the packages are already there as part of installing.NET Core. Yeah, we cash all these things in 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.NET Core 2.0, we have this new feature called a runtime store. So all those binaries are actually already there as part of.NET Core 2.0. So, and they're warmed up and cross-gen and 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 1.1. Yeah, in.NET Core 1.1 or 1.0 application, we were actually publishing 15 megs of MVC every single time you publish. It was really good MVC bits. But yes, you did have to bring them with you. Now you don't have to do that at all. You can 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 set up the server like wire up Kestrel, set up 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 config for you. We'll actually put config in DI by default and we'll wire up the like JSON config providers for app settings.json. 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. The config stuff is probably one of my favorite. One of my biggest complaints about ASP.NET Core 1.0 or 1.1 was developers told me, oh, you have to create an object, put your configuration and inject that into DI. And I'm like just put the configuration in there for me so I can access it from any of my controllers. We did that for you. You can just use it from wherever you want to. And as a result, my startup code now is much cleaner. Like I don't have to set up 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, the debug 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? You can, of course. All those APIs 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 would like to just add some pages to this app. How do I do that? 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 2.0. It's built on MVC 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 and I'm going to add a new item right here. Show you how quick and easy it is to get started now writing dynamic UI. I'm going to add a razor page, index CSHTML. That means it's just going to be the home page of my app and we should get some razor and there it is. All right, cool. Now a razor file with nothing in it yet. We'll fix that. This is kind of like ASP.NET web pages. A little bit. It's 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 the namespace for all my pages. That's from MVC. It just works. View start, that just works. Tag helpers, that just works because it's built on top of MVC. So I get all the power in MVC and I get the ability to do CSHTML files in a folder just like I could with web pages. So I get the best of both worlds. You get the best of both worlds, exactly. So I have a code behind file. This is my page model. This is the model that I'm going to use to decide what to render on the page. So let's add some stuff. Like let's do something simple. So I'm going to 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 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 know, like date time dot now, and we'll make that a string so that we can easily render it on the page. All right, okay. So now if I save that on my page, that'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 dot 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. So 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 go. And you're ready to go. I love this. I don't have to have a controller folder, a views folder, I don't have to have routes. I don't have to understand how writing works between all that stuff. Yeah, you can still do those things, of course. You have controllers 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 gonna do file new project now. And we have, of course, templates for razor pages. I'm gonna select to create a new ASP.NET core app. So I can mix the two systems together. I can have some views and controllers and some razor pages on the same application. You can do them both and they work beautifully side by side. You can have some web APIs that are that are MPC controllers and have some UI with razor pages. That just works. While you're on the screen, we should point out these new templates you got. I was about to do that. Got to do that. So here I'm gonna 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 views and controllers. The same template that we've always had still works and 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, for React, for React plus Redux. That's just an easy way to get started with building a spa with ASP.NET Core as a backend. We're gonna work with razor pages. So let's add that. This is gonna 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 wanna do here is add a form. Razor pages is great for doing form space programming. So I'm gonna open up the pages folder and the routes to the pages are just determined by where they are on disk. So if I wanna go to the contact page, I just go to slash contacts. So there's index, that's the home page, there's contact and there's about. You notice that we also have view imports, view start. Those are, it's just built on MVC 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 wanna add a form here that lets you submit your contact info so that we can contact you about our great products, you know, something like that. Super easy, so what we're gonna do is we're gonna go to the code behind file and I'm just gonna 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 an email address so that we can actually contact you. Now I want some validation on this guy so I'm gonna make 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 gotta give me both. Okay, so now I want to render a form on my page using this contact model. So I'm gonna add a property to my page model of type contact, okay? And that's gonna allow me now in my contact CSHTML. This model type will have that property and I can use that to render the form. I'll spare you the typing on that. I've got it 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 it's actually 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. If we run this, we should be able to see that form now. Now there's nothing that's, this is gonna post to yet. We need to add that in a second but let's just make sure we've got our UI. So this should brought us to the homepage. We've got a 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 request. So we're gonna add another page handler. Instead of on get, we'll have an on post. I've 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. It's action results, cause let me see again. So what's this gonna do? So when we post the form data, it's gonna check the model 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 some place like in a database. We're not gonna do that here but you would just have a DB context. You inject it into the page model like you would a controller. It goes in the constructor. Works just like that, like it is in NBC. You could also inject into the page itself with that inject, all the directives work. And then if the things are all good, then we'll just, it'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 gonna do is I'm just gonna set like a success message like yes, thank you for your contact information. We got it, you are good to go. So I don't know, like thanks. I'll just reference that same property contact.name whoever 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 P tag and just set up some bootstrap so that it shows up in green. So like text to success because this is a success message. Now I think there's also one more thing I gotta change which is on this on get. I don't wanna re-clear the message. I wanna 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 that should bind someplace. I could actually put it in the post arguments. That's just like you could with an MVC action. But instead of doing that because I'm already got this property right here I'm just gonna bind it right here to this property. That's super convenient. And you can do that on your MVC controllers too. Like if you wanna 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 by temp data. And so that means when I set that property it'll populate into temp data. When I read from that property it'll read it out of temp data. And that should be it. Okay so let's go back to our page and let's click submit. And I didn't put any data in so I expect to get like 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. So that's razor pages. Very cool, very simple. If you publish it, it'll be smaller. Also when you publish it and run it it'll start up faster than it would in 1.1 because the runtime store is already cross-gen. 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 2.0. That's a new feature that we have in 2.0 as well is we're pre-compiling CSHML files as part of publish. As part of publish by default. You just, you don't have to do anything. It'll just happen. And then at runtime like you said it'll be faster because the throughput of 2.0 is faster than 1.1 as well. Awesome, thank you. You're welcome. So let's move on. Next we have NDD Framework Core 2.0. NDD Framework Core is a new version of NDD Framework that we built as we built .NET Core. The primary goal of NDD Framework Core was to have obviously a version of NDD Framework that ran cross-platform just like .NET Core does. But one of the things I like to think about with NDD Framework Core is it's a version of .NET Core kind of internally we used to call it NDD Framework everywhere because the idea is it can run anywhere today. So it used to be that NDD Framework could only run on the .NET Framework but now it runs on .NET Core. It's .NET standard compliant as well which means it technically can run on UWP as well. So whether, or Xamarin. So whether you're building a .NET Framework app, a .NET Core application, Xamarin application or even a UWP application in the RS3 timeframe. You have the same data framework that can go all those places. Another cool thing about NDD Framework is we have a couple goals here and one of them is to obviously make it very easy to build awesome applications with Azure SQL and SQL Server. And so we've actually enabled features in SQL Server like in-memory tables that you can actually just do with attributes within NDD 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 NDD Framework Core and I've got a couple of the features on the screen here that are new to NDD Framework Core too. My favorite one is probably the performance improvements. If you're used to programming at ADO.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 NDD Framework contexts. I'm gonna have Diego Vega come up and present some of these features. So people can go to the.NET blog to read the announcement and see an overview of the new features. This one is about the fact that we look at performance profiles of some ASP.NET core applications that we're using EF Core 2.0, sorry, previous version. And we realized that we were spending a lot of time creating instances of the DB context. Yeah, pretty much anytime we create a controller. Yeah. When the request comes in, we create a controller. We're gonna create a context because most people make the context a member of their controller. Yes, that's it. And we try to address this in two different ways in 2.0. One is first make it cheaper to create. You know, like we have a context that is using dependency injection internally to create its own dependencies. And those are our scope. They get created for every request and then they go away. And we reuse the number of objects that need to be created for each one. But we also took a more radical approach based on the same idea that we have been using for connection. Connection pooling for all the years. Yeah. And that is, well, basically we can have like a pre-created set of DB context instances that are ready to be used 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 back in the pool and reuse it for the next request that's open. And all we need to make sure is that we are cleaning up all the state that needs to be cleaned up, that we are disposing all the objects that need to be disposed and things like that. So we're going to show a demo that is actually one of the simplest demos that I have seen. This is actually a console application that is simulating everything that an ASP.net core application would do with the DB context. It has this small DB context with just one entity. And then it has this section where we are configuring services. This line here that has the call to DB context is important. That's the registration of the DB context type that I'm 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. And this one is doing a lookup in the database. So we're going to run this the way it is and we're going to see some numbers. So this is executing a bunch of requests. It's creating a bunch of threads to simulate what was happening in a regular application. In this particular case, we're creating context a lot of times. Every time one of these requests comes through, we're creating a context. So we're throwing a bunch of memory out there, a bunch of times. Just like ASP.net core went and optimized a lot of memory usage away. Now you're going to show a new version of this that actually 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 work. Which is a lot. That were like more than 70,000. And also the number of requests per second is the throughput that we achieve with this way of doing things. Yep. Now, I said that this is a very easy demo because all I need to do to enable the new feature is to change this call to add the context to a new API that is called add the context pool. And this one, the way it works is basically it's wiring up the same capabilities in dependency injection, but instead of giving you a new instance of the context every time, it's going to give you one from the pool. So one line code change, rerun the application, and what do we see? So we are seeing that very quickly, we achieve a better throughput than before. I can see the better throughput, and I bet at the end here we're going to see that, look at that, only 32 contexts created versus 70,000. Yeah, that's dramatic, dramatic difference because there's going to be much less allocations to serve the same number of requests. So I take my existing EF core code, I change one line of code, and my web application, and suddenly I'm using a lot less memory, and my application's faster. Awesome. Less garbage collection as well. So one detail people usually ask about this is that, why is that we are not adding this to the default template, even that it's so good, and that performance is so much better with this way? And the reason we don't do that is because we want people to be aware that the feature changes how things are going to work. And for instance, when you create this blog in context, this is your own user class. It's derived from the DB 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, your own state. If you put your own state 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 state with everybody. So once again, as soon as you pool something, you need to be aware, don't be putting your own private user data inside of that DB context because it's not your own private data anymore. Yeah, exactly. So the feature knows how to reset all the state of the DB context that we know about on every time we put it back in the pool. But you obviously don't know about what the user puts on the class. That's something that we can improve in the feature, 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 that I wanted to show is a very simple feature, and this one is also very easy. And I think that this is a, I want to- Yeah, I like this feature too. Yeah, I want to give the language team some credit here, actually all the credit because they build this feature that is string interpolation. The string interpolation that we added in C-sharp. Yeah, if you look at this code, what it's doing is basically using an EF model and it's using a feature that we call from SQL, which you can use to execute your own SQL in a composable way. So you can invoke some SQL with from SQL and then you can continue adding link operators on top of it. But I want to be careful here. I don't want to have any like SQL injection here because I'm passing a parameter in here. So this is protecting against SQL injection, I would assume. So this is protecting you from SQL injection, but in the way that we did it in the first version of EF code. So if I show you how this works, basically it's asking for a term, I'm going to type cut here. This is showing me the SQL that gets generated. I'm putting the select. I can see the variable there. There was a parameter generated for it and it's being passed to this. This is actually a table value function in SQL server that is being invoked. Yes. And this is safe, but it's not as nice. So one thing I may want to do if I'm using the new features in C sharp. Yeah, because I'm still seeing a zero here, which as I'm doing by order. So C sharp allows you to do. I can actually put the variable directly in there. Yeah. A dollar sign there and then just say, okay, I want to put term here. Oh, sorry. I mean term and this is a more concise way of writing this query. I know it myself and I've been SQL in the past. I've passed so many things in that I was zero, one, two, three, four, five and by the time and all the parameters scrolled off the 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 the place I want is amazing. And now you support that with the native framework core. Yes, the thing is that if you did this with the first version of native framework core, it would expose you to, I mean, it will fail. But if you add some quoting here, probably to turn this to the string, then it would be exposing you to SQL injection. SQL injection. So what we wanted to do is say, okay, we want people to be able to use this nice way of writing the query and incorporating the parameters in line in the query. But we wanted to work the right way. So we wanted to create parameters for them and we want it to be safe. Perfect, I love it. So I get all the features of string interpolation in C-sharp. I get all the protection from SQL injection, all with the EF core 2.0. Yeah. Awesome. So if we execute this now, it's the same as say we ask for fish and it's also generating the parameter on the, and using it in the call to the variable function here. So the way this works, people are curious when they see this demo, is really because the language team implemented this in a very smart way. They created a new type that is called FormatableString that can hold all the information for an interpolated string, including like the text and also the parameters. So we created a new overload from SQL that takes a FormatableString. So we can actually capture the whole intent in one variable and then we create the SQL 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, D-O-T dot N-E-T, 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 microservice 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 e-book format. If you want, you can download a PDF of these books and read them offline. You can also read them online on docs.microsoft.com. 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 resource is each of these contains a sample as well. So if you select microservices and containers, you get a great book to learn how to build and write microservices 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 that you're going to find in the sample applications are things like you're going to see health checks. Those types of things are patterns that we're going to actually move out of the samples and put into the actual .NET core in the future. So if you're looking at how to build modern apps of .NET and .NET 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 .NET standard two. I think it's the most important thing here because it means all of my .NETs, Xamarin, .NET framework, .NET core all have the same set of common APIs across all the great code sharing. You can continue to see we have performance. We had great performance results with .NET core 1.0. We're continuing to push that envelope again as Dan was saying earlier, 20% improvement in the tech and power benchmark for ASP.NET core. And then the other part of this is nothing makes .NET 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 of .NET. And .NET core too is supported across all of them. So go out, download .NET core 2 today at dot.NET slash core and give us feedback on how it works.