 Hi, I'm Scott Hunter, and I'm here with Alia today, and we're going to talk about how you can actually take WinForm and WPF applications and move them from .NET Framework to .NET Core 3. To start off, let's talk about .NET Core 3. .NET Core 3 doesn't ship as part of Visual Studio 2019, but previous are available. You can try it today with Visual Studio 2019. .NET Core 3 brings the desktop workloads to .NET Core. So we're bringing WinForms and WPF to .NET Core, because .NET Core is open-source, we couldn't just bring them to .NET Core, we had to open-source them. So in December of 2018, we open-sourced WinForms and WPF. They're both in GitHub available today in open-source. People are already contributing to them, but that's part of our journey of bringing the desktop to Core. The next thing is, why would you want to port your application from .NET Framework to .NET Core? What I would tell you is, if you have a desktop application, you're not changing anymore. You probably shouldn't want to port it, but if you have a desktop application that you're actively developing on, there are a variety of benefits you're going to get by moving to .NET Core. One of those is going to be, .NET Core is our fast innovating version of .NET. So if you want the latest C-Sharp, if you want the latest frameworks, if you want the latest BCL, latest all those things, it's going to be .NET Core. .NET Core is fully side-by-side, which means we can actually innovate there faster with that risk of breaking existing applications. The second thing is, we've always had feedback about deployment, and I'll give you an idea of what that means. With .NET Framework, if you want to take advantage of the latest feature in .NET Framework, you have to wait until your IT department has actually put that version of .NET Framework on all the machines in your office. With .NET Core, we actually give you the flexibility of either having .NET Core installed on the machine, or you can actually just install .NET Core as part of your application, meaning that you'll actually take the files from .NET Core and put them in the same folder of your application. Or even better, if you want, you can actually check a box in Visual Studio, and we will make a single exe that contains the latest version of .NET Core, and your application all bundled together. This means you can build a desktop application using the latest C-Sharp and install it on any machine in the network without worrying about what version of .NET is on that machine. The second thing is the BCL. The BCL is the base class libraries in .NET that make all the things that you do work. Because .NET Framework is installed once globally on the machine and installed on billions of machines, we can't really change much of the BCL there. Even a slight change might break the applications. But in .NET Core, we're actually able to do that because you can opt-in when you want the next version of the framework. Because of this, we've been able to actually optimize many of the features in the BCL, they're much faster. Just by moving your application to .NET Core, you're likely to see a 20 or 30 percent improvement in performance because of these API improvements. Then finally, the next area that I think is really impressive is desktop applications. We have been trying to figure out how to make them better. We created the UWP platform a couple of years ago, but it required you to rewrite your entire application in UWP. Now with XAML Islands, you can take any of the new controls in UWP and inject them into your WinForm or WPF application which means you can touch enable an existing desktop application just by using one of those controls. Maybe you want a modern browser control or modern media control. You can bring those directly in to do that. So all of these end up being a bunch of great reasons to actually move to .NET Core 3. Hi, my name is Olya Gavrysh. I am PM on .NET team and today I talk about how you port your framework desktop application to .NET Core. You probably have many questions as where do I start? What do I do with my class libraries? Are there available tools to help me porting and so on? Luckily, we thought about all that and we put together step-by-step porting guide available on our .NET block where you can see how each stage in all details is performed. We took a WinForms application and ported it to Core describing all possible challenges you might encounter and available solutions for that. So when you will be porting, consult with that guide and now I'll just briefly talk about migration process. So to migrate to .NET Core, you simply need to update your target framework to .NET Core 3 version. If you're lucky, that is the only change you need to do and your application will be fully migrated. But it might happen that your project is using old project file style and that is a long HTML file that has many items and properties. You cannot edit it right away. You need to first unload your project and then you'll be able to look in your project file. The main problem with that is that target framework property does not know about .NET Core or .NET Standard. It was created way before those two were around and you cannot just specify desired version of .NET Core to migrate. To be able to migrate to Core, you first need to update your project file to the latest so-called SDK style. Our blog post describes how you do it in all details. Once you're done, you can move your project to .NET Core. Another thing that we are working on right now are our designers. WinForms and WPF designers are not yet available for your .NET Core 3 project, but there is a workaround how you can benefit from the designer experience for your new projects. To do that, you just link existing .NET Framework source into the new .NET Core app. Then when you want to edit your user interface, you open all .NET Framework application, you make changes. Those changes will be immediately translated to your new .NET Core project that you will use for everything else. So if you're porting your application from Framework to Core, you might have dependencies on some APIs that are not available in Core, but available in Framework. If you encounter that issue, Windows Compatibility Pack might help you solving it. Windows Compat Pack is distributed as a NuGet package. It has 21,000 APIs from a framework that were not included in .NET Standard, but you can still keep using them, even targeting .NET Core.NET Standard. If you're installed Compatibility Pack, you want to install API Analyzer as well. API Analyzer is a Rosalind tool that prompts you every time you're using API that is not cross-platform or API that is deprecated. So you can, on the floor, while your coding be prompted and make decisions regarding the risk of not having your code being supported on other platforms. And with that, I will jump into demo and show you how you port your desktop applications to .NET Core. So today, we will port a Windows application. This is a memory game where you have decks for cards facing down and you're trying to find a match. If you look at this app, this is a Windows Forms UI matching game project and game logic project, which is a class library targeting .NET Framework. My user interface has dependency on class library and class library does not depend on any other projects in the application. So I will start porting with the class library. I always recommend start porting projects that have least dependencies. So to update it to .NET Core, we need to open the project file. And as you can see for this project, we cannot open it right away. We need to unload our project and then do edit match game. And here we can see old properties that does not support .NET Core. So first, we need to update old format to the new SDK style project. I happen to have a code snippet here, but to see how it looks like, you can just create new empty .NET Core or .NET Standard project and copy paste the content of the project file. Now when we save and reload the project, we can see that it opens right away. So it's fully migrated. So please notice that I'm also using generate assembly info and setting it to false. The reason I do it because I already have assembly.info.cs file in my project and new SDK style project generates assembly info automatically. So to disable duplication, I disable generation of assembly info or you can simply delete the file from your disk. So now my project file is ready for me to update it to .NET Core. And in fact, because this is class library, I'm going to update it to .NET Standard because I might want to reuse this code in other projects and .NET Standard will be compatible with any .NET project. So for your class library, I always recommend to use standard instead of core. All right, let's see. So now our project is migrated to .NET Standard but we have some issues related to registry API. The reason is registry is APIs available only for Windows and .NET Standard is a cross-platform project. And this is the case where compatibility pack will help us to resolve those dependencies. So to install Windows compatibility pack, I go to manage new git packages and I search for Microsoft Windows compatibility. So I install this guy and this errors disappear. Perfect. But now to be able to track all the APIs that are not cross-platform, I will also install API analyzer. For that, I will search for Microsoft .NET analyzers compatibility. It is in pre-release version so I need to click include pre-releases. I'm going to install this. Right, so now I got some notifications and I see that for registry API, I'm notified that this isn't supported on Linux or Mac OS. I can customize all those notifications. I can suppress them if I don't want to see them or choose how I'd like to be prompted as a form of error, warning or information. This is all available for you. So right now, we're fully migrated our game logic project and let's see if it works and it does. So with that, I will give it back to Scott. Thank you for watching. So thanks, Alia, for that demo, showing how you can port a WinForm application from .NET Framework to .NET Core. Now that you've done that, let's talk about the future. .NET Core 3 will ship later this year but you can run the previews of .NET Core 3 today on the Visual Studio 2019 preview channel. .NET Core is completely side by side meaning that you can install the 3R preview with no risks of breaking a 2.2, a 2.1 or a 2.0 or even a 1.x application. We have a guide on this page that will send you to some directions on how to port an application from .NET Framework to .NET Core and if you have any questions about that there's an email Alias here as well. Feel free to send us questions, feedback on how you port your applications. Any of that will help us build a better product and I look forward to you trying .NET Core 3.