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

Fix MethodAccessException when configuring EF Core DB context #714

Merged
merged 1 commit into from
Jul 3, 2023

Conversation

DiFFoZ
Copy link
Member

@DiFFoZ DiFFoZ commented Jun 19, 2023

Fixes the exception that throws on non-Mono runtimes

[10:45:49 INF][OpenMod.Runtime.OpenModHostedService] Initializing for host: Openmod Standalone v0.0.0+b482449e2623fe726bac734274e1dcd532c259d3
[10:45:49 INF][OpenMod.Runtime.OpenModHostedService] Loading plugins...
[10:45:49 ERR][OpenMod.Core.Plugins.PluginActivator] Failed to load plugin from type: Shops.ShopsPlugin in assembly: Shops-91f958, Version=2.0.5.0, Culture=neutral, PublicKeyToken=null
System.MethodAccessException: Attempt by method 'OpenMod.EntityFrameworkCore.MySql.Extensions.MySqlContainerBuilderExtensions.AddMySqlDbContextInternal(Autofac.ContainerBuilder, System.Type, System.Action`1<Microsoft.EntityFrameworkCore.DbContextOptionsBuilder>, System.Nullable`1<Microsoft.Extensions.DependencyInjection.ServiceLifetime>)' to access method 'OpenMod.EntityFrameworkCore.Extensions.EntityFrameworkCoreContainerBuilderExtensions.AddDbContextInternal(Autofac.ContainerBuilder, System.Type, System.Action`1<Microsoft.EntityFrameworkCore.DbContextOptionsBuilder>, System.Nullable`1<Microsoft.Extensions.DependencyInjection.ServiceLifetime>, OpenMod.EntityFrameworkCore.Configurator.IDbContextConfigurator)' failed.
   at OpenMod.EntityFrameworkCore.MySql.Extensions.MySqlContainerBuilderExtensions.AddMySqlDbContextInternal(ContainerBuilder containerBuilder, Type dbContextType, Action`1 optionsBuilder, Nullable`1 serviceLifetime)
   at OpenMod.EntityFrameworkCore.MySql.Extensions.MySqlContainerBuilderExtensions.AddMySqlDbContext[T](ContainerBuilder containerBuilder)
   at OpenMod.Core.Plugins.PluginActivator.<>c__DisplayClass11_1.<TryActivatePluginAsync>b__0(ContainerBuilder containerBuilder)
   at Autofac.Core.Lifetime.LifetimeScope.CreateScopeRestrictedRegistry(Object tag, Action`1 configurationAction)
   at Autofac.Core.Lifetime.LifetimeScope.BeginLifetimeScope(Object tag, Action`1 configurationAction)
   at OpenMod.Core.Ioc.LifetimeScopeExtensions.BeginLifetimeScopeEx(ILifetimeScope this, Action`1 configurationAction)
   at OpenMod.Core.Plugins.PluginActivator.<TryActivatePluginAsync>d__11.MoveNext()

@Trojaner Trojaner merged commit 155ad4d into main Jul 3, 2023
29 checks passed
@Trojaner Trojaner deleted the fix-methodaccessexception-efcore branch July 3, 2023 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants