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 for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube