Open brminnick opened 1 year ago
Adding the blocked
label until Device Unit Tests are available
@brminnick thanks for assigning this over. I'll be honest I didn't know this existed.
One question - what do you think adding the Nuget reference into Directory.props? That way new projects won't have to include it
The only hesitation I have is that it may affect our Unit Test projects, causing some extra headaches when writing tests. But, it likely won't, so it's probably fine to add it in Directory.Build.props
Feature name
Add
MemoryAnalyzer
Link to discussion
https://github.com/CommunityToolkit/Maui/pull/1371
Progress tracker
Summary
This Proposal would add a new Roslyn Analyzer: MemoryAnalyzers, a set of Roslyn C# code analyzers for finding memory leaks in iOS and MacCatalyst applications, created by @jonathanpeppers on Microsoft's .NET MAUI team.
Motivation
The .NET MAUI team adopted
MemoryAnalyzers
, adding it to their code base in this PR: https://github.com/dotnet/maui/pull/16346/filesWe should strive to avoid introducing new memory leaks and this analyzer will aid us in avoiding them.
In addition, we strive to mirror the .NET MAUI repo as closely as possible to make it easy for us to promote features from the .NET MAUI Community Toolkit into .NET MAUI. Implementing
MemoryAnalzyers
will ensure our code is production ready for .NET MAUI when the time comes to promote a feature.Detailed Design
Directory.Build.props
We'll set
<WarningsAsErrors>
for everyMemoryAnalyzer
analyzerEvery
CSPROJ
fileIn every
.csproj
file, we will add a Private dependency toMemoryAnalyzers
Device Unit Tests
We will write platform-specific unit tests for iOS, Android, Tizen, Windows and MacCatalyst to ensure that the changes proposed by
MemoryAnalyzers
does not break any existing behavior.Usage Syntax
Drawbacks
We are not able to implement this feature until Device Tests are available. I.e. we are currently not able to write platform-specific unit tests for frameworks such as
net7.0-ios
.Alternatives
None
Unresolved Questions
No response