Skip to content
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

Remove MauiApplicationServiceCollection and use MakeReadOnly #10097

Merged
merged 1 commit into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 0 additions & 103 deletions src/Core/src/Hosting/Internal/MauiApplicationServiceCollection.cs

This file was deleted.

4 changes: 2 additions & 2 deletions src/Core/src/Hosting/MauiAppBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Microsoft.Maui.Hosting
/// </summary>
public sealed class MauiAppBuilder
{
private readonly MauiApplicationServiceCollection _services = new();
private readonly ServiceCollection _services = new();
private Func<IServiceProvider>? _createServiceProvider;
private readonly Lazy<ConfigurationManager> _configuration;
private ILoggingBuilder? _logging;
Expand Down Expand Up @@ -152,7 +152,7 @@ public MauiApp Build()
MauiApp builtApplication = new MauiApp(serviceProvider);

// Mark the service collection as read-only to prevent future modifications
_services.IsReadOnly = true;
_services.MakeReadOnly();

var initServices = builtApplication.Services.GetServices<IMauiInitializeService>();
if (initServices != null)
Expand Down