canton7 / Stylet

A very lightweight but powerful ViewModel-First MVVM framework for WPF for .NET Framework and .NET Core, inspired by Caliburn.Micro.
MIT License
981 stars 143 forks source link

Using MicrosoftDependencyInjectionBootstrapper runtime errors #277

Closed litiansky closed 2 years ago

litiansky commented 2 years ago

Description System.InvalidOperationException HResult=0x80131509 Message=No service for type 'InvoicingSys.Client.Wpf.Pages.ShellViewModel' has been registered. Source=Microsoft.Extensions.DependencyInjection.Abstractions StackTrace: at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at InvoicingSys.Client.Wpf.MicrosoftDependencyInjectionBootstrapper1.GetInstance(Type type) in C:\Development_Avecto\Sky\Work\InvoicingSys\src\InvoicingSys.Client.Wpf\MicrosoftDependencyInjectionBootstrapper.cs:line 64 at InvoicingSys.Client.Wpf.MicrosoftDependencyInjectionBootstrapper1.get_RootViewModel() in C:\Development_Avecto\Sky\Work\InvoicingSys\src\InvoicingSys.Client.Wpf\MicrosoftDependencyInjectionBootstrapper.cs:line 17 at InvoicingSys.Client.Wpf.MicrosoftDependencyInjectionBootstrapper`1.Launch() in C:\Development_Avecto\Sky\Work\InvoicingSys\src\InvoicingSys.Client.Wpf\MicrosoftDependencyInjectionBootstrapper.cs:line 69 at Stylet.BootstrapperBase.Start(String[] args) at Stylet.BootstrapperBase.b__9_0(Object o, StartupEventArgs e) at System.Windows.Application.OnStartup(StartupEventArgs e) at InvoicingSys.Client.Wpf.App.<>n0(StartupEventArgs e) at InvoicingSys.Client.Wpf.App.d3.MoveNext() in C:\Development_Avecto\Sky\Work\InvoicingSys\src\InvoicingSys.Client.Wpf\App.xaml.cs:line 53

Version Info

Additional Info I want to use the ABP VNext framework. If the MVVM framework is not applicable, ABP can inject services and access them, but with stylet, ABP services cannot be injected properly. Please help me, I have been working on it for more than two weeks.