GokGokalp / MetroBus

Lightweight messaging wrapper of MassTransit
MIT License
72 stars 24 forks source link

'MassTransit.ExtensionsDependencyInjectionIntegration.Configuration.Registration.DependencyInjectionContainerR egistrar #21

Open can-acar opened 4 years ago

can-acar commented 4 years ago

Selam, .Net Core 3.1'a upgrade yaptığımda aşağıdaki exceptionı alıyorum ;

System.TypeLoadException: Method 'RegisterExecuteActivity' on type 'MassTransit.ExtensionsDependencyInjectionIntegration.Configuration.Registration.DependencyInjectionContainerR
egistrar' from assembly 'MassTransit.ExtensionsDependencyInjectionIntegration, Version=5.5.2.0, Culture=neutral, PublicKeyToken=b8e0e9f2f1e657fa' tried to implicitly implement a
n interface method with weaker type parameter constraints.
   at MassTransit.ExtensionsDependencyInjectionIntegration.Configuration.Registration.ServiceCollectionConfigurator..ctor(IServiceCollection collection)
   at MassTransit.DependencyInjectionRegistrationExtensions.AddMassTransit(IServiceCollection collection, Action`1 configure)
   at MetroBus.Microsoft.Extensions.DependencyInjection.MetroBusExtensions.AddMetroBus(IServiceCollection serviceCollection, Action`1 configure)
   at ilan.BusConfig.UseBusService(IServiceCollection services, MqConstant mqConstant) in D:\Projects\x\ilan\BusConfig.cs:line 15
   at ilan.Startup.ConfigureServices(IServiceCollection services) in D:\Projects\x\ilan\Startup.cs:line 64
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass9_0.<Invoke>g__Startup|0(IServiceCollection serviceCollection)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass8_0.<Build>b__0(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass12_0.<UseStartup>b__0(HostBuilderContext context, IServiceCollection services)
   at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at ilan.Program.Main(String[] args) in D:\Projects\x\x\Program.cs:line 32

Problem;

 public class BusService : IHostedService
    {
        private readonly IBusControl BusControl;

        public BusService(IBusControl busControl)
        {
            BusControl = busControl;
        }

        public Task StartAsync(CancellationToken cancellationToken)
        {
            return BusControl.StartAsync(cancellationToken);
        }

        public Task StopAsync(CancellationToken cancellationToken)
        {
            return BusControl.StopAsync(cancellationToken);
        }

IBusControl'ı inject yaparken oluyor.