Error trying to resolve Service 'ServiceStack.AuthFeature' from Adapter 'NetCoreContainerAdapter'

Hi there,
I’m trying to integrate with Wolverine for a proof of concept app. It uses Lamar under the hood. Everything seems to be running fine until when it comes to Authentication or IAuthSession. I’m getting the following error. It is trying to resolve IAuthSession, which is not registered in the container. I don’t think is should be registered anyways.

Any ideas on this? I can reach out to the other project once I can confirm it’s not something I am doing wrong here. I’m on the latest version of SS via MyGet(6.7.1).


ServiceStack Services are registered in ServiceStack’s IOC, so it wont be able to be resolved via Lamar’s IOC.

Services are resolved using TryResolve<T> which calls ASP .NET Core’s optional GetService<T> API which should return null when trying to resolve a dependency that doesn’t exist, whereas this is throwing. so it needs to be configured to return null instead of throwing.

Great! Resolved with:

What’s the best way to do this for all SS Services?

This doesn’t seem to fix the issue, services resolved with GetService<T> shouldn’t throw, and It shouldn’t be trying to resolve IAuthSession in the first place, which isn’t a Service. Whatever is causing it to try to resolve IAuthSession should be prevented.