News

.NET MAUI Team Stamps Out Memory Leaks, Tweaks NuGet Packaging

Microsoft's dev team for .NET MAUI is stamping out memory leaks and improving NuGet functionality in .NET 8 Preview 3.

The framework evolves its predecessor, Xamarin.Forms, by adding support to build desktop apps in addition to traditional Xamarin targets iOS and Android.

Released last week, .NET MAUI (.NET Multi-platform App UI) in .NET 8 Preview 3 mostly continues the effort to improve the quality of UI controls, layout and memory management, Microsoft said.

For the latter, senior engineer Jonathan Peppers is credited with hunting and eliminating memory leaks and tracking the team's progress on that front.

"He found that when navigating forward and back repeatedly the memory would grow ~2.45KB each time," Microsoft said in an April 11 announcement. "By implementing a WeakList<T> to keep track of references, he was able to make sure the memory is properly released." Similar memory improvements were enacted across other constructs, including buttons, pages, layouts, windows and more as the team prioritizes the highest-impact issues on the most-used controls. In addition to Layout, those include CollectionView, Shell and drawing: shapes, shadows and clipping.

Another part of the quality push is the ability to layer specific versions of NuGet packages into a project, which Microsoft said is useful for:

  • reviewing a pull request
  • previewing unreleased or experimental builds
  • pinning a project to specific version
[Click on image for larger view.] Navigate to Azure Build Pipeline (source: Microsoft).

As shown in the graphic above, developers can go to any pull request or branch at the GitHub dotnet/maui repo and navigate to the associated Azure build pipeline by clicking a green checkmark to locate the build artifacts. They can then be downloaded and extracted to a local directory. After setting a NuGet source path to that same directory -- or using a nuget.config file -- developers can specify the version (for example, 8.0.0-ci.net8.11560) of that build within a project's csproj file. More about that can be found in the Workloads distribution and management is understandable and seamless for developers issue.

Further information can also be found in Preview 3's release notes, which list a whopping 107 bugs fixed so far.

[Click on image for larger view.] Navigate to Azure Build Pipeline (source: Microsoft).

That speaks to the developer engagement on the project, which Microsoft said is one of the most active projects under the direction of the .NET Foundation (see graphic above). "When you combine Android, iOS and .NET MAUI together, it's far and away the most active for issues and pull requests," Microsoft said. "In less than a year .NET MAUI usage has grown 450 percent. Our goal in .NET 8 is to make you even more successful using .NET to build apps for Android, iOS, macOS, and Windows with .NET MAUI."

Many of the fixes in .NET MAUI previews for .NET 8 have also been introduced into a .NET 7 service release.

.NET 8 will ship in November.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube