Could not load type 'GraphQL.Server.Transports.AspNetCore.IGraphQLRequestDeserializer' from assembly
Hello,
I am using latest version of GraphQL.Server.All - 7.7.1. Which includes all required graphql library for 7.7.1 Getting following errorand need your help to resolve it.
System.Reflection.ReflectionTypeLoadException
HResult=0x80131602
Message=Unable to load one or more of the requested types.
Could not load type 'GraphQL.Server.Transports.AspNetCore.IGraphQLRequestDeserializer' from assembly 'GraphQL.Server.Transports.AspNetCore, Version=7.7.1.0, Culture=neutral, PublicKeyToken=e6238258560628ee'.
Could not load type 'GraphQL.Server.Transports.AspNetCore.GraphQLRequestDeserializationResult' from assembly 'GraphQL.Server.Transports.AspNetCore, Version=7.7.1.0, Culture=neutral, PublicKeyToken=e6238258560628ee'.
Source=System.Private.CoreLib
StackTrace:
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Test.GraphQLConfiguration.<>c.<ConfigureGraphQL>b__0_2(Assembly a) in C:\project\Extensions\GraphQLConfiguration.cs:line 36
at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at ConfigureGraphQL(IServiceCollection services) in C:\project\Extensions\GraphQLConfiguration.cs:line 33
at Test.Web.Startup.ConfigureServices(IServiceCollection services) in C:\project\Startup.cs:line 123
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
at Microsoft.AspNetCore.Hosting.StartupLoader.ConfigureServicesDelegateBuilder`1.<>c__DisplayClass14_0.<ConfigureServices>g__ConfigureServicesWithContainerConfiguration|0(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
The interface IGraphQLRequestDeserializer only exists in version 5 and older versions of the project. Can you post a list of all your GraphQL NuGet packages you have installed?
Please ensure you have removed any references to these obsolete packages:
- GraphQL.Server.Core
- GraphQL.Server.Transports.AspNetCore.NewtonsoftJson
- GraphQL.Server.Transports.AspNetCore.SystemTextJson
- GraphQL.Server.Transports.Subscriptions.Abstractions
- GraphQL.Server.Transports.Subscriptions.WebSockets
- GraphQL.Server.Transports.WebSocktes
See:
- https://github.com/graphql-dotnet/server?tab=readme-ov-file#aspnet-core-graphql-server-driven-by-graphqlnet