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

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events