Ten artykuł jest lustrzanym artykułem tłumaczenia maszynowego, kliknij tutaj, aby przejść do oryginalnego artykułu.

Widok: 31956|Odpowiedź: 0

[Źródło] Obejście wyjątków Core w MySQL Entity Framework

[Skopiuj link]
Opublikowano 18.11.2019 15:39:21 | | |
System.TypeLoadException:“Method 'get_Info' in type 'Pomelo.EntityFrameworkCore.MySql.Infrastructure.Internal.MySqlOptionsExtension' from assembly 'Pomelo.EntityFrameworkCore.MySql, Version=2.2.6.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.”
System.TypeLoadException:“Method 'get_Info' in type 'MySql.Data.EntityFrameworkCore.Infraestructure.MySQLOptionsExtension' from assembly 'MySql.Data.EntityFrameworkCore, Version=8.0.18.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' does not have an implementation.”
Autofac.Core.DependencyResolutionException: An exception was thrown while activating λ:Microsoft.EntityFrameworkCore.DbContextOptions[] -> λ:Microsoft.EntityFrameworkCore.DbContextOptions -> λ:Microsoft.EntityFrameworkCore.DbContextOptions`1[[itsvse.DomainModels.itsvseDb, itsvse.DomainModels, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].
---> System.TypeLoadException: Metoda 'get_Info' w typie 'MySql.Data.EntityFrameworkCore.Infraestructure.MySQLOptionsExtension' z asembla 'MySql.Data.EntityFrameworkCore, Version=8.0.18.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' nie posiada implementacji.
   at Microsoft.EntityFrameworkCore.MySQLDbContextOptionsExtensions.UseMySQL
   na itsvse. WebUI.Startup. <ConfigureServices>b__4_0(DbContextOptionsBuilder opt) w C:\Users\DELL\source\repos\itsvse\itsvse. WebUI\Startup.cs:linia 39
   na stronie Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.<>c__DisplayClass3_0'2. <AddDbContextPool>b__0(IServiceProvider _, DbContextOptionsBuilder ob)
   na stronie Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.<>c__DisplayClass5_0'2. <AddDbContextPool>b__0(IServiceProvider sp, DbContextOptionsBuilder ob)
   at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.DbContextOptionsFactory[TContext](IServiceProvider applicationServiceProvider, Action'2 opcjeAction)
   na stronie Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.<>c__DisplayClass10_0'1. <AddCoreServices>b__0(IServiceProvider p)
   na stronie Autofac.Extensions.DependencyInjection.AutofacRegistration.<>c__DisplayClass3_0. <Register>b__0(kontekst IComponentContext, parametry IEnumerable'1)
   at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable'1 parameters)
   na Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable'1 parameters, Object& decoratorTarget)
   --- Koniec wewnętrznego śledzenia stosu wyjątków ---
   na Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable'1 parameters, Object& decoratorTarget)
   at Autofac.Core.Resolving.InstanceLookup.Execute()
   na Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable'1 parametrów)
   na Autofac.Core.Resolving.ResolveOperation.ResolveComponent(IComponentRegistration registration, IEnumerable'1 parametry)
   na Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable'1 parameters)
   at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable'1 parametry)
   at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable'1 parameters, Object& instance)
   at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable'1 parameters)
   na Autofac.ResolutionExtensions.Resolve(IComponentContext context, Typ serviceType, IEnumerable'1 parametry)
   at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType)
   at Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetRequiredService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetServices[T](IServiceProvider provider)
   at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.FindContextTypes()
   na stronie Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.FindContextType(Nazwa ciągu znaków)
   at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.CreateContext(String contextType)
   at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.AddMigration(String name, String outputDir, String contextType)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigrationImpl(String name, String outputDir, String contextType)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigration.<>c__DisplayClass0_0. <.ctor>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0'1. <Execute>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Wyjątek został wyrzucony podczas aktywacji λ:Microsoft.EntityFrameworkCore.DbContextOptions[] -> λ:Microsoft.EntityFrameworkCore.DbContextOptions -> λ: Microsoft.EntityFrameworkCore.DbContextOptions'1[[itsvse. DomainModels.itsvseDb, itsvse. DomainModels, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].


Na początku instalacji znajdowały się następujące



Później zainstalowano




Ostateczne rozwiązanie to zainstalowanie następującej wersji:







Poprzedni:EF Core pit: DbContextPool powoduje wyczerpanie połączenia z bazą danych
Następny:[Obca cywilizacja dynastii Tang]. Napisane przez Schaefera. (Douban 9,0 punktów) .PDF
Zrzeczenie się:
Całe oprogramowanie, materiały programistyczne lub artykuły publikowane przez Code Farmer Network służą wyłącznie celom edukacyjnym i badawczym; Powyższe treści nie mogą być wykorzystywane do celów komercyjnych ani nielegalnych, w przeciwnym razie użytkownicy ponoszą wszelkie konsekwencje. Informacje na tej stronie pochodzą z Internetu, a spory dotyczące praw autorskich nie mają z nią nic wspólnego. Musisz całkowicie usunąć powyższą zawartość z komputera w ciągu 24 godzin od pobrania. Jeśli spodoba Ci się program, wspieraj oryginalne oprogramowanie, kup rejestrację i korzystaj z lepszych, autentycznych usług. W przypadku naruszenia praw prosimy o kontakt mailowy.

Mail To:help@itsvse.com