Updated to 6.10.0 Unable to load one or more of the requested types

Started getting this error, not sure why

System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Method 'DetermineServiceOperationEndpoint' in type 'ServiceStack.Aws.Sqs.Fake.FakeAmazonSqs' from assembly 'ServiceStack.Aws, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at Microsoft.AspNetCore.Mvc.Controllers.ControllerFeatureProvider.PopulateFeature(IEnumerable`1 parts, ControllerFeature feature)
   at Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.PopulateFeature[TFeature](TFeature feature)
   at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetControllerTypes()
   at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetDescriptors()
   at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.UpdateCollection()
   at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.Initialize()
   at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.GetChangeToken()
   at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)

Any ideas?

This is typically the result of having dirty .dlls for different versions of ServiceStack together, make sure all ServiceStack Package references are either using a 6.* wildcard or are referencing the exact same version of all packages.

Yeah, we are using CentralizedPackgeVersion, so all Servicestack is on the same version solution wide.

Something isn’t right, you have one assembly attempting to access a DetermineServiceOperationEndpoint method on FakeAmazonSqs that AFAICT has never existed.

Seems to happen here

app.UseEndpoints(endpoints =>
{
    endpoints.MapRazorPages(); <----
});

Which probably means it’s a Razor compilation issue, are you using DetermineServiceOperationEndpoint anywhere in your code base?

No. I don’t get any search results back solution wide for DetermineServiceOperationEndpoint

ok not sure then because it’s never existed in our code base AFAICT.

Maybe check you’re using the same AWSSDK versions as ServiceStack.Aws:

<PackageReference Update="AWSSDK.Core" Version="3.7.201.9" />
<PackageReference Update="AWSSDK.DynamoDBv2" Version="3.7.201" />
<PackageReference Update="AWSSDK.S3" Version="3.7.203.4" />
<PackageReference Update="AWSSDK.SQS" Version="3.7.200.30" />

The exact versions that ServiceStack.Aws references:

<PackageReference Include="AWSSDK.Core" Version="3.7.200.6" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.200.7" />
<PackageReference Include="AWSSDK.S3" Version="3.7.201.4" />
<PackageReference Include="AWSSDK.SQS" Version="3.7.200.7" />

I’m trying these now :slight_smile:

That fixed it. Thank you.

1 Like