step-up-labs / firebase-authentication-dotnet

C# library for Firebase Authentication
MIT License
376 stars 129 forks source link

wpf with dependency injection #191

Closed eduardoagr closed 1 year ago

eduardoagr commented 1 year ago

I love your package

I have a slight problem.

` _host = Host.CreateDefaultBuilder() .ConfigureServices((context, services) => {

            string? FireKey = context.Configuration.GetValue<string>("FIREBASE_KEY");

            services.AddSingleton(new FirebaseAuthProvider(new FirebaseConfig(FireKey)));
            services.AddSingleton((services) => new MainWindow());

        })
        .Build();
}

protected override void OnStartup(StartupEventArgs e) {

    MainWindow = _host.Services.GetRequiredService<MainWindow>();
    MainWindow.Show();

    var auth = _host.Services.GetRequiredService<FirebaseAuthProvider>();
    auth.CreateUserWithEmailAndPasswordAsync("a@a.com", "1234", "ed");

    base.OnStartup(e);
}

`

144 Cannot create an instance of the abstract type or interface 'FirebaseAuthProvider' 246 The type or namespace name 'FirebaseConfig' could not be found (are you missing a using directive or an assembly reference?) 'FirebaseAuthProvider' does not contain a definition for 'CreateUserWith EmailAnd PasswordAsync' and no accessible extension method 061 'CreateUserWithEmailAnd PasswordAsync' accepting a first argument of type 'FirebaseAuthProvider' could be found (are you missing a using directive or an assembly reference?)

I do not understand I always use this

bezysoftware commented 1 year ago

Looks like you're using v3 of the library, I would suggest using v4