-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
breaking: Remove .NET Standard 2.0, modernize AOT compatibility #4257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
glennawatson
wants to merge
10
commits into
main
Choose a base branch
from
glennawatson/aot-warnings
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+28,636
−18,893
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… enhance test coverage
BREAKING CHANGES:
1. Removed .NET Standard 2.0 support - minimum target is now net6.0
2. Removed RxApp.cs - replaced with RxAppBuilder pattern
3. Removed PlatformRegistrationManager.cs - replaced with modern builder pattern
4. Solution file renamed: ReactiveUI.sln → reactiveui.slnx (SLNX format)
5. Removed polyfill attributes now built into modern .NET:
- CallerArgumentExpressionAttribute
- DoesNotReturnIfAttribute
- NotNullAttribute
- IsExternalInit
6. Removed platform-specific ComponentModelTypeConverter implementations
7. Removed legacy DefaultViewLocator.AOT.cs
## Migration Guide
### .NET Standard 2.0 Removal
Projects targeting .NET Standard 2.0 must upgrade to at least .NET 6.0. ReactiveUI
now requires modern .NET with built-in nullable reference types, init properties,
and AOT attributes.
**Before:**
- Supported: netstandard2.0, net462+, net6.0+
- Used polyfill attributes for modern C# features
**After:**
- Minimum: net6.0 for cross-platform, net462 for Windows-only legacy
- Uses built-in .NET attributes for nullable/AOT support
### RxApp Removal
The static RxApp class has been removed in favor of the builder pattern.
**Before:**
```csharp
RxApp.MainThreadScheduler.Schedule(() => { });
RxApp.TaskpoolScheduler.Schedule(() => { });
After:
// Use RxSchedulers for AOT-safe scheduler access
RxSchedulers.MainThreadScheduler.Schedule(() => { });
RxSchedulers.TaskpoolScheduler.Schedule(() => { });
// Or use builder pattern for initialization
var builder = RxAppBuilder.CreateReactiveUIBuilder(resolver)
.WithCoreServices()
.BuildApp();
Solution File Renamed
Before: src/ReactiveUI.sln (legacy text format)
After: src/reactiveui.slnx (XML-based format)
Impact:
- Update CI/CD scripts referencing ReactiveUI.sln → reactiveui.slnx
- Requires Visual Studio 2022 17.10+ or JetBrains Rider 2024.1+ for IDE support
- All dotnet CLI commands work identically (no syntax changes)
Major Enhancements
Test Coverage (80%+ achieved)
- Reorganized test projects for better coverage analysis
- Removed duplicate/obsolete test projects:
- ReactiveUI.AOTTests (consolidated into main tests)
- ReactiveUI.Builder.Tests (consolidated)
- ReactiveUI.Splat.Tests (functionality moved to core)
- ReactiveUI.Testing.Tests (consolidated)
- Fixed intermittent test failures with proper Locator scoping
- Added comprehensive MAUI activation tests
- Enhanced builder API tests with WithInstance coverage
AOT Compatibility Improvements
This branch addresses numerous AOT warnings and improves trimming compatibility:
- Removed reflection-heavy PlatformRegistrationManager
- Removed ComponentModelTypeConverter (used reflection)
- Streamlined view locator implementation (removed AOT-specific version)
- All polyfill attributes removed (used UnconditionalSuppressMessage)
- Improved DynamicallyAccessedMembers usage throughout codebase
Bug Fixes
- Nested property binding: Fixed redundant setter calls that caused performance
issues and unexpected behavior when binding to nested properties
- MAUI activation: Resolved activation lifecycle issues in MAUI controls
- Test flakiness: Fixed race conditions in Locator-dependent tests by
introducing LocatorScope pattern
API Enhancements
- Builder API: Added BuilderMixins with WithInstance pattern for better testability
- XML Documentation: Comprehensive docs added to:
- All public interfaces (IActivatableView, IViewFor, etc.)
- Suspension APIs (ISuspensionHost, ISuspensionDriver)
- Interaction APIs (IInteraction, IInteractionContext)
- View locator and activation APIs
- Usage Examples: Added code examples to public API documentation
Documentation Improvements
Added comprehensive educational documentation (CLAUDE.md, copilot-instructions.md):
SLNX Format Documentation
- What SLNX is (XML-based solution format, VS 2022 17.10+)
- Key differences from .sln (structured XML vs proprietary text)
- IDE compatibility requirements
- CLI usage (identical to .sln files)
Microsoft Testing Platform (MTP) Documentation
- What MTP is and why ReactiveUI uses it (modern test platform replacing VSTest)
- How MTP differs from VSTest (argument syntax, configuration)
- Configuration files explained (global.json, testconfig.json, Directory.Build.props)
- Best practices:
- Never use --no-build flag (causes stale binary issues)
- Correct argument placement: dotnet test flags BEFORE --, TUnit flags AFTER --
- How to see Console.WriteLine output (--output Detailed)
- Non-parallel test execution rationale
Command Reference Improvements
- Fixed coverage argument placement (--coverage goes BEFORE --)
- Reorganized command-line flags by tool (dotnet test vs TUnit)
- Removed contradictory examples (--no-build)
- All solution references updated to reactiveui.slnx
Dependency Updates
- TUnit 1.7.5 → latest (modern testing framework)
- Verify.TUnit 31.9.2 → 31.9.3 (snapshot testing)
- Microsoft.Extensions.DependencyModel → v10
- Roslynator.Analyzers → 4.15.0
- Syncfusion.MAUI.Toolkit → 1.0.8
Technical Details
Files Changed Statistics
- 819 files changed
- 59,545 insertions(+)
- 27,543 deletions(-)
Key Deletions
- src/ReactiveUI.sln → migrated to reactiveui.slnx
- src/ReactiveUI/RxApp.cs → replaced with RxAppBuilder pattern
- src/ReactiveUI/PlatformRegistrationManager.cs → replaced with builder pattern
- src/ReactiveUI/RegistrationNamespace.cs → obsolete with new registration approach
- src/ReactiveUI/Helpers/*.cs → polyfill attributes removed (4 files)
- src/ReactiveUI/IsExternalInit.cs → built into modern .NET
- src/ReactiveUI.*/GlobalUsings.cs → removed from Maui/WinUI (2 files)
- src/ReactiveUI/Platforms/*/ComponentModelTypeConverter.cs → reflection-based, removed (3 files)
- src/ReactiveUI/View/DefaultViewLocator.AOT.cs → consolidated with main implementation
- Multiple test projects consolidated (ReactiveUI.AOTTests, Builder.Tests, Splat.Tests, etc.)
Platform Support Matrix
Before:
- netstandard2.0 (cross-platform)
- net462, net472, net481 (Windows legacy)
- net6.0, net8.0, net9.0, net10.0 (modern)
After:
- net462, net472, net481 (Windows legacy - minimum for Windows-only projects)
- net6.0, net8.0, net9.0, net10.0 (cross-platform minimum)
- net8.0/9.0/10.0-windows10.0.19041.0 (Windows-specific features)
- iOS, tvOS, macOS, Android, MAUI targets unchanged
Co-authored-by: Christian Fischerauer [email protected]
…yet) Fixed the converter tests Use builders in assembly hooks
ChrisPulman
approved these changes
Jan 5, 2026
Member
ChrisPulman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Offline comments given on feedback
…pe converter tests Added a new converter state, and registrations in the ReactiveUIBuilder - Introduced `PlatformConverterAffinityTests` to verify that platform-specific converters have the correct affinity values. - Updated existing type converter tests to reflect the correct affinity values, changing expected results from 10 to 2 for various converters including Byte, Decimal, Double, Integer, Long, and others. - Added `WpfLocatorScope` to manage WPF-specific service registrations in tests. - Refactored `RoutedViewHostTests` and `ViewModelViewHostTests` to utilize `WpfLocatorScope` for better state management during tests. - Ensured that the `DefaultViewLocatorTests` correctly initializes the reactive UI builder with WPF support.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BREAKING CHANGES:
Migration Guide
.NET Standard 2.0 Removal
Projects targeting .NET Standard 2.0 must upgrade to at least .NET 8.0. ReactiveUI
now requires modern .NET with built-in nullable reference types, init properties,
and AOT attributes.
Before:
After:
RxApp Removal
The static RxApp class has been removed in favor of the builder pattern.
Before:
Solution File Renamed
Before: src/ReactiveUI.sln (legacy text format)
After: src/reactiveui.slnx (XML-based format)
Impact:
Major Enhancements
Test Coverage (80%+ achieved)
AOT Compatibility Improvements
This branch addresses numerous AOT warnings and improves trimming compatibility:
Bug Fixes
API Enhancements
Documentation Improvements
Added comprehensive educational documentation (CLAUDE.md, copilot-instructions.md):
SLNX Format Documentation
Microsoft Testing Platform (MTP) Documentation
Command Reference Improvements
Key Deletions
Platform Support Matrix
Before:
After:
Co-authored-by: Christian Fischerauer [email protected]