{"id":46095,"date":"2023-06-13T10:12:00","date_gmt":"2023-06-13T17:12:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/dotnet\/?p=46095"},"modified":"2023-06-15T16:15:32","modified_gmt":"2023-06-15T23:15:32","slug":"announcing-dotnet-maui-in-dotnet-8-preview-5","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-dotnet-maui-in-dotnet-8-preview-5\/","title":{"rendered":"Announcing .NET MAUI in .NET 8 Preview 5"},"content":{"rendered":"<p>Hello everyone! I&#8217;m thrilled to announce that .NET MAUI in .NET 8 Preview 5 is now available with lots of bug fixes and performance improvements for cross-platform app development. In this post, I&#8217;ll summarize some of the most important changes in this release and show you how to update your .NET MAUI project to use this release.<\/p>\n<h2>What&#8217;s fixed and improved in .NET MAUI<\/h2>\n<p>Preview 5 is another quality-focused update that fixes many issues and enhances the performance of the framework, including:<\/p>\n<ul>\n<li><strong>iOS Keyboard Scrolling:<\/strong> ContentInsets were added to improve the scrolling behavior of the iOS keyboard. <a href=\"https:\/\/github.com\/dotnet\/maui\/pull\/14371\">#14371<\/a><\/li>\n<li><strong>Test Improvements:<\/strong> Various improvements and fixes were made to the tests, including the removal of the skip attribute from a test related to SearchBarHandler. <a href=\"https:\/\/github.com\/dotnet\/maui\/pull\/14852\">#14852<\/a><\/li>\n<li><strong>Performance Enhancements:<\/strong> Performance improvements were made to the {Binding} mechanism and the layout performance of labels on Android. <a href=\"https:\/\/github.com\/dotnet\/maui\/pull\/14830\">#14830<\/a>, <a href=\"https:\/\/github.com\/dotnet\/maui\/pull\/14933\">#14933<\/a>, <a href=\"https:\/\/github.com\/dotnet\/maui\/pull\/14980\">#14980<\/a><\/li>\n<li><strong>Bug Fixes:<\/strong> Several bug fixes were implemented, addressing issues such as gestures in Label Spans, Entry issues with the keyboard, Label truncation on iOS, CollectionView issues, ContentView RTL, and more. <a href=\"https:\/\/github.com\/dotnet\/maui\/pull\/14410\">#14410<\/a>, <a href=\"https:\/\/github.com\/dotnet\/maui\/pull\/14382\">#14382<\/a>, <a href=\"https:\/\/github.com\/dotnet\/maui\/pull\/14453\">#14453<\/a>, <a href=\"https:\/\/github.com\/dotnet\/maui\/pull\/14391\">#14391<\/a>, <a href=\"https:\/\/github.com\/dotnet\/maui\/pull\/11763\">#11763<\/a>, <a href=\"https:\/\/github.com\/dotnet\/maui\/pull\/15114\">#15114<\/a>, <a href=\"https:\/\/github.com\/dotnet\/maui\/pull\/12909\">#12909<\/a><\/li>\n<\/ul>\n<p>These are just some of the highlights of this release. For a complete list of changes, please check out the <a href=\"https:\/\/github.com\/dotnet\/maui\/releases\">release notes<\/a>.<\/p>\n<h2>How to update<\/h2>\n<p>Visual Studio 2022 on Windows now includes .NET 8 previews and the .NET MAUI preview workload. Download the latest preview version 17.7 Preview 2, select the .NET Multi-platform App UI workload, and then check the optional component &#8220;.NET MAUI (.NET 8 Preview)&#8221;.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2023\/06\/vs17.7-p2-installer.png\"><img decoding=\"async\" class=\"alignnone wp-image-46109 size-full\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2023\/06\/vs17.7-p2-installer.png\" alt=\"Visual Studio installer checkbox for .NET MAUI and .NET 8 previews\" width=\"1296\" height=\"738\" srcset=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2023\/06\/vs17.7-p2-installer.png 1296w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2023\/06\/vs17.7-p2-installer-300x171.png 300w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2023\/06\/vs17.7-p2-installer-1024x583.png 1024w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2023\/06\/vs17.7-p2-installer-768x437.png 768w\" sizes=\"(max-width: 1296px) 100vw, 1296px\" \/><\/a><\/p>\n<p>If you are on macOS, you may download the <a href=\"https:\/\/dotnet.microsoft.com\/download\/dotnet\/8.0\">.NET 8 preview 5 installer<\/a>, and then install .NET MAUI from the command line:<\/p>\n<pre><code class=\"language-bash\">dotnet workload install maui<\/code><\/pre>\n<p>To verify that everything is installed correctly, you can run the following command:<\/p>\n<pre><code class=\"language-bash\">dotnet --list-sdks<\/code><\/pre>\n<p>You should see something like this:<\/p>\n<pre><code class=\"language-text\">8.0.100-preview.5.23303.2 [C:\\Program Files\\dotnet\\sdk]<\/code><\/pre>\n<p>And to verify you have the correct .NET MAUI workload, run the command:<\/p>\n<pre><code class=\"language-bash\">dotnet workload list<\/code><\/pre>\n<p>You should see something like this:<\/p>\n<pre><code class=\"language-text\">Installed Workload Id      Manifest Version                            Installation Source\r\n-----------------------------------------------------------------------------------------------------------\r\nmaui-windows               8.0.0-preview.5.8529\/8.0.100-preview.5      VS 17.5.33627.172, VS 17.7.33808.371\r\nmaui-maccatalyst           8.0.0-preview.5.8529\/8.0.100-preview.5      VS 17.5.33627.172, VS 17.7.33808.371\r\nmaccatalyst                16.4.8525-net8-p5\/8.0.100-preview.5         VS 17.5.33627.172, VS 17.7.33808.371\r\nmaui-ios                   8.0.0-preview.5.8529\/8.0.100-preview.5      VS 17.5.33627.172, VS 17.7.33808.371\r\nios                        16.4.8525-net8-p5\/8.0.100-preview.5         VS 17.5.33627.172, VS 17.7.33808.371\r\nmaui-android               8.0.0-preview.5.8529\/8.0.100-preview.5      VS 17.5.33627.172, VS 17.7.33808.371\r\nandroid                    34.0.0-preview.5.312\/8.0.100-preview.5      VS 17.5.33627.172, VS 17.7.33808.371<\/code><\/pre>\n<h3>Updating existing projects<\/h3>\n<p>To update your .NET MAUI project to use 8.0.0-preview.5.8529, you first need to install the .NET 8 Preview 5 SDK and then update the .NET MAUI NuGet packages in your project. You can use Visual Studio or Visual Studio for Mac to manage your NuGet packages or edit your project file manually.<\/p>\n<p>To use Visual Studio or Visual Studio for Mac, right-click on your project and select &#8220;Manage NuGet Packages&#8230;&#8221; then select the &#8220;Include prerelease&#8221; option and search for Microsoft.Maui.<em> packages. Update all the packages to version 8.0.0-preview.5.8529. To edit your project file manually, open it in a text editor and find the <code>ItemGroup<\/code> element that contains the <code>PackageReference<\/code> elements for Microsoft.Maui.<\/em> packages. Update all the Version attributes to 8.0.0-preview.5.8529.<\/p>\n<p>Your project file should have an <code>ItemGroup<\/code> that looks something like this:<\/p>\n<pre><code class=\"language-xml\">&lt;ItemGroup&gt;\r\n    &lt;PackageReference Include=\"Microsoft.Maui.Controls\" Version=\"$(MauiVersion)\" \/&gt;\r\n    &lt;PackageReference Include=\"Microsoft.Maui.Controls.Compatibility\" Version=\"$(MauiVersion)\" \/&gt;\r\n    &lt;PackageReference Include=\"Microsoft.Extensions.Logging.Debug\" Version=\"8.0.0-preview.5.23280.8\" \/&gt;\r\n&lt;\/ItemGroup&gt;<\/code><\/pre>\n<p>Now you can build and run your project using Visual Studio or Visual Studio for Mac or use the dotnet build command with the -t:Run target:<\/p>\n<pre><code class=\"language-bash\">dotnet build -t:Run -f net8-android MyMauiApp.csproj<\/code><\/pre>\n<p>This will build and launch your app on an Android emulator or device.<\/p>\n<h2>Feedback Welcome<\/h2>\n<p>We appreciate your feedback and contributions to .NET MAUI. You can <a href=\"https:\/\/github.com\/dotnet\/maui\/issues\/new\/choose\">report issues<\/a>, <a href=\"https:\/\/github.com\/dotnet\/maui\/issues\/new?assignees=&amp;labels=proposal%2Fopen%2Ct%2Fenhancement&amp;projects=&amp;template=feature-request.yml\">suggest features<\/a>, or <a href=\"https:\/\/github.com\/dotnet\/maui\/blob\/main\/.github\/CONTRIBUTING.md\">submit pull requests<\/a> on our GitHub repository. You can also join our Discord server or follow us on Twitter to stay in touch with the latest news and updates.<\/p>\n<p>Thank you for your support and happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>.NET MAUI makes its way to .NET 8 Preview 5 and is full of new quality improvements for developers across the entire framework. In addition, we are introducing NuGet packages even greater flexibility going forward.<\/p>\n","protected":false},"author":553,"featured_media":46096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685,7233],"tags":[7701,7238],"class_list":["post-46095","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","category-maui","tag-dotnet-8","tag-net-maui"],"acf":[],"blog_post_summary":"<p>.NET MAUI makes its way to .NET 8 Preview 5 and is full of new quality improvements for developers across the entire framework. In addition, we are introducing NuGet packages even greater flexibility going forward.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/46095","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/553"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=46095"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/46095\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/46096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=46095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=46095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=46095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}