fgilde / MudBlazor.Extensions

MudBlazor.Extensions from https://www.mudex.org is a small extension for MudBlazor from https://mudblazor.com
http://www.mudex.org
MIT License
231 stars 20 forks source link

[Bug]: ReflectionTypeLoadException with Mudblazor 6.17.0 #73

Closed PmE8HW0KRfqa closed 6 months ago

PmE8HW0KRfqa commented 6 months ago

Contact Details

No response

What happened?

After upgrading Mudblazor from 6.16.0 to 6.17.0, I get a ReflectionTypeLoadException when adding MudExtensions with

builder.Services.AddMudServicesWithExtensions(c => c.WithoutAutomaticCssLoading());
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Method 'Show' on type 'MudBlazor.Extensions.Services.MudExDialogService' from assembly 'MudBlazor.Extensions, Version=1.7.84.0, Culture=neutral, PublicKeyToken=null' tried to implicitly implement an interface method with weaker type parameter constraints.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at Nextended.Core.Extensions.ServiceCollectionExtensions.<>c.<RegisterAllImplementationsOf>b__4_1(Assembly a)
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at Nextended.Core.Extensions.ServiceCollectionExtensions.RegisterAllImplementationsOf(IServiceCollection services, Type[] interfacesToSearchImplementationsFor, Assembly[] assembliesToSearchImplementationsIn, ServiceLifetime lifeTime)
   at MudBlazor.Extensions.ServiceCollectionExtensions.AddMudExtensions(IServiceCollection services, Assembly[] serviceImplementationAssemblies)
   at MudBlazor.Extensions.ServiceCollectionExtensions.AddMudExtensions(IServiceCollection services, Action`1 config, Assembly[] serviceImplementationAssemblies)
   at MudBlazor.Extensions.ServiceCollectionExtensions.AddMudServicesWithExtensions(IServiceCollection services, Action`1 config, Assembly[] serviceImplementationAssemblies)
   at Program.<Main>$(String[] args) in /home/david/github/WebAppV3/WebAppV3/Program.cs:line 39
System.TypeLoadException: Method 'Show' on type 'MudBlazor.Extensions.Services.MudExDialogService' from assembly 'MudBlazor.Extensions, Version=1.7.84.0, Culture=neutral, PublicKeyToken=null' tried to implicitly implement an interface method with weaker type parameter constraints.

Expected Behavior

No exception.

Screenshots

No response

Reproduction link

No response

What application type are you referring to?

Please select an application type...

Custom Application Type

No response

MudBlazor.Extension Version

1.7.84

MudBlazor Version

6.17.0

What browser are you using?

Chrome

Sample Solution

No response

Pull Request

No response

Code of Conduct

jaypalexa commented 6 months ago

Not adding anything new, but confirming that I am seeing same after updating MudBlazor to 6.17.0 at:

builder.Services.AddMudExtensions();  /* <<< EXCEPTION OCCURS HERE */
builder.Services.AddMudServicesWithExtensions();
System.Reflection.ReflectionTypeLoadException
  HResult=0x80131602
  Message=Unable to load one or more of the requested types.
Method 'Show' on type 'MudBlazor.Extensions.Services.MudExDialogService' from assembly 'MudBlazor.Extensions, Version=1.7.84.0, Culture=neutral, PublicKeyToken=null' tried to implicitly implement an interface method with weaker type parameter constraints.
  Source=System.Private.CoreLib
  StackTrace:
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at Nextended.Core.Extensions.ServiceCollectionExtensions.<>c.<RegisterAllImplementationsOf>b__4_1(Assembly a)
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at Nextended.Core.Extensions.ServiceCollectionExtensions.RegisterAllImplementationsOf(IServiceCollection services, Type[] interfacesToSearchImplementationsFor, Assembly[] assembliesToSearchImplementationsIn, ServiceLifetime lifeTime)
   at MudBlazor.Extensions.ServiceCollectionExtensions.AddMudExtensions(IServiceCollection services, Assembly[] serviceImplementationAssemblies)

Also using MudBlazor.Extensions 1.7.84.

fgilde commented 6 months ago

Looks like interface changed. I will update asap

fgilde commented 6 months ago

Should be solved in 1.7.85

MudBlazor.Extensions 1.7.85 Nuget